aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/xen/blkfront
diff options
context:
space:
mode:
authorJustin T. Gibbs <gibbs@FreeBSD.org>2012-03-25 14:20:43 +0000
committerJustin T. Gibbs <gibbs@FreeBSD.org>2012-03-25 14:20:43 +0000
commit0d1723240053e99843509ab1ab0ff00449eeba74 (patch)
treeaef237ec065dc3e3098e0fec613495b94e6e3bc9 /sys/dev/xen/blkfront
parentbd944e019ebbfbe7dfa6b5040c0878508ef65a90 (diff)
Notes
Diffstat (limited to 'sys/dev/xen/blkfront')
-rw-r--r--sys/dev/xen/blkfront/blkfront.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c
index 3061a82a26f0..f36ffb128082 100644
--- a/sys/dev/xen/blkfront/blkfront.c
+++ b/sys/dev/xen/blkfront/blkfront.c
@@ -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,