From owner-svn-src-all@FreeBSD.ORG Sun Mar 25 14:20:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E42B0106564A; Sun, 25 Mar 2012 14:20:44 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9028FC1A; Sun, 25 Mar 2012 14:20:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2PEKi1C085306; Sun, 25 Mar 2012 14:20:44 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2PEKi2p085304; Sun, 25 Mar 2012 14:20:44 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201203251420.q2PEKi2p085304@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sun, 25 Mar 2012 14:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233465 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2012 14:20:45 -0000 Author: gibbs Date: Sun Mar 25 14:20:43 2012 New Revision: 233465 URL: http://svn.freebsd.org/changeset/base/233465 Log: Correct failure to attach the PV block front device on Citrix XenServer configurations that advertise the multi-page ring extension, but only allow a single page of ring space. sys/dev/xen/blkfront/blkfront.c: If only one page of ring space is being used, do not publish in the XenStore the number of pages in use (1), via either of the supported multi-page ring extension schemes. Single page operation is the same with or without the ring-page extension being negotiated. Relying on the legacy behavior avoids an incompatible difference in how the two ring-page extension schemes that are out in the wild, deal with the base case of a single page. The Amazon/Red Hat drivers use the same XenStore variable as if the extension was not negotiated. The Citrix drivers assume the new ring reference XenStore variables will be available Reported by: Oliver Schonefeld MFC after: 3 days Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sun Mar 25 13:20:38 2012 (r233464) +++ head/sys/dev/xen/blkfront/blkfront.c Sun Mar 25 14:20:43 2012 (r233465) @@ -698,21 +698,25 @@ blkfront_initialize(struct xb_softc *sc) return; /* Support both backend schemes for relaying ring page limits. */ - error = xs_printf(XST_NIL, node_path, - "num-ring-pages","%u", sc->ring_pages); - if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/num-ring-pages", - node_path); - return; - } - error = xs_printf(XST_NIL, node_path, - "ring-page-order","%u", fls(sc->ring_pages) - 1); - if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/ring-page-order", - node_path); - return; + if (sc->ring_pages > 1) { + error = xs_printf(XST_NIL, node_path, + "num-ring-pages","%u", sc->ring_pages); + if (error) { + xenbus_dev_fatal(sc->xb_dev, error, + "writing %s/num-ring-pages", + node_path); + return; + } + + error = xs_printf(XST_NIL, node_path, + "ring-page-order", "%u", + fls(sc->ring_pages) - 1); + if (error) { + xenbus_dev_fatal(sc->xb_dev, error, + "writing %s/ring-page-order", + node_path); + return; + } } error = xs_printf(XST_NIL, node_path,