From: cl349@firebug.cl.cam.ac.uk Date: Wed, 24 Aug 2005 08:55:14 +0000 (+0000) Subject: Add some additional error nodes when block device setup fails. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16864 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=73e3ad1b3d952c26a7778645aef57b9db8d090bb;p=xen.git Add some additional error nodes when block device setup fails. Signed-off-by: Christian Limpach --- diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c index a4d5f11aaa..2f2fdfc3cd 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c @@ -75,7 +75,7 @@ static void frontend_changed(struct xenbus_watch *watch, const char *node) err = xenbus_gather(be->frontpath, "grant-id", "%lu", &sharedmfn, "event-channel", "%u", &evtchn, NULL); if (err) { - xenbus_dev_error(be->dev, err, + xenbus_dev_error(be->dev, err, "reading %s/grant-id and event-channel", be->frontpath); return; @@ -177,6 +177,9 @@ static void backend_changed(struct xenbus_watch *watch, const char *node) err = register_xenbus_watch(&be->watch); if (err) { be->watch.node = NULL; + xenbus_dev_error(dev, err, + "adding frontend watch on %s", + be->frontpath); goto device_fail; } } @@ -211,12 +214,15 @@ static void backend_changed(struct xenbus_watch *watch, const char *node) if (IS_ERR(be->blkif)) { err = PTR_ERR(be->blkif); be->blkif = NULL; + xenbus_dev_error(dev, err, "creating block interface"); goto device_fail; } err = vbd_create(be->blkif, handle, be->pdev, be->readonly); - if (err) + if (err) { + xenbus_dev_error(dev, err, "creating vbd structure"); goto device_fail; + } frontend_changed(&be->watch, be->frontpath); } @@ -238,8 +244,10 @@ static int blkback_probe(struct xenbus_device *dev, int err; be = kmalloc(sizeof(*be), GFP_KERNEL); - if (!be) + if (!be) { + xenbus_dev_error(dev, -ENOMEM, "allocating backend structure"); return -ENOMEM; + } memset(be, 0, sizeof(*be)); @@ -247,8 +255,11 @@ static int blkback_probe(struct xenbus_device *dev, be->backend_watch.node = dev->nodename; be->backend_watch.callback = backend_changed; err = register_xenbus_watch(&be->backend_watch); - if (err) + if (err) { + xenbus_dev_error(dev, err, "adding backend watch on %s", + dev->nodename); goto free_be; + } dev->data = be; diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 161c3107bf..e32f91a035 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -1165,8 +1165,10 @@ static int talk_to_backend(struct xenbus_device *dev, /* Create shared ring, alloc event channel. */ err = setup_blkring(dev, info); - if (err) + if (err) { + xenbus_dev_error(dev, err, "setting up block ring"); goto out; + } err = xenbus_transaction_start(dev->nodename); if (err) {