Date: Wed, 28 Mar 2012 19:40:58 +0000 (UTC) From: "Justin T. Gibbs" <gibbs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r233626 - stable/9/sys/dev/xen/blkfront Message-ID: <201203281940.q2SJew95051410@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gibbs Date: Wed Mar 28 19:40:58 2012 New Revision: 233626 URL: http://svn.freebsd.org/changeset/base/233626 Log: MFC Revision 233465 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 <schonefeld@ids-mannheim.de> Modified: stable/9/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/9/sys/dev/xen/blkfront/blkfront.c Wed Mar 28 19:20:28 2012 (r233625) +++ stable/9/sys/dev/xen/blkfront/blkfront.c Wed Mar 28 19:40:58 2012 (r233626) @@ -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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203281940.q2SJew95051410>