# HG changeset patch
# User emellor@ewan
# Node ID 6fda96e7f3329b376f4e5f47483d126446f514ba
# Parent d79ab87e27b8f88621234f7fb5bfeb24a8d33a89
# Parent 96cc6aa196b6e079488fabcc2eef32c38f7ff890
Added some DPRINTK statements, for debugging.
diff -r d79ab87e27b8 -r 6fda96e7f332
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon Oct 3 15:40:27 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Tue Oct 4 10:27:37 2005
@@ -63,13 +63,23 @@
struct backend_info *be
= container_of(watch, struct backend_info, watch);
+ DPRINTK("frontend_changed: %s.\n", be->frontpath);
+
/* If other end is gone, delete ourself. */
if (node && !xenbus_exists(be->frontpath, "")) {
+ DPRINTK("Frontend has disappeared; unregistering device.\n");
device_unregister(&be->dev->dev);
return;
}
- if (be->blkif == NULL || be->blkif->status == CONNECTED)
- return;
+ if (be->blkif == NULL) {
+ DPRINTK("blkif is null; doing nothing.\n");
+ return;
+ }
+
+ if (be->blkif->status == CONNECTED) {
+ DPRINTK("blkif is CONNECTED; doing nothing.\n");
+ return;
+ }
err = xenbus_gather(be->frontpath, "ring-ref", "%lu", &ring_ref,
"event-channel", "%u", &evtchn, NULL);
@@ -132,10 +142,11 @@
xenbus_dev_ok(be->dev);
+ DPRINTK("frontend_changed(%s) finished OK.\n", be->frontpath);
return;
-
abort:
xenbus_transaction_end(1);
+ DPRINTK("frontend_changed(%s) aborted.\n", be->frontpath);
}
/*
@@ -152,9 +163,13 @@
= container_of(watch, struct backend_info, backend_watch);
struct xenbus_device *dev = be->dev;
+ DPRINTK("backend_changed: %s\n", watch->node);
+
err = xenbus_scanf(dev->nodename, "physical-device", "%li", &pdev);
- if (XENBUS_EXIST_ERR(err))
- return;
+ if (XENBUS_EXIST_ERR(err)) {
+ DPRINTK("physical-device node exists; doing nothing.\n");
+ return;
+ }
if (err < 0) {
xenbus_dev_error(dev, err, "reading physical-device");
return;
@@ -174,6 +189,8 @@
}
if (be->blkif == NULL) {
+ DPRINTK("be->blkif is null; creating VBD.\n");
+
/* Front end dir is a number, which is used as the handle. */
p = strrchr(be->frontpath, '/') + 1;
handle = simple_strtoul(p, NULL, 0);
@@ -197,6 +214,11 @@
/* Pass in NULL node to skip exist test. */
frontend_changed(&be->watch, NULL);
}
+ else {
+ DPRINTK("be->blkif is non-null; doing nothing.\n");
+ }
+
+ DPRINTK("backend_changed(%s) finished OK.\n", watch->node);
}
static int blkback_probe(struct xenbus_device *dev,
@@ -218,8 +240,10 @@
"frontend-id", "%li", &be->frontend_id,
"frontend", NULL, &frontend,
NULL);
- if (XENBUS_EXIST_ERR(err))
- goto free_be;
+ if (XENBUS_EXIST_ERR(err)) {
+ DPRINTK("blkback_probe: %s does not exist", dev->nodename);
+ goto free_be;
+ }
if (err < 0) {
xenbus_dev_error(dev, err,
"reading %s/frontend or frontend-id",
@@ -231,6 +255,8 @@
* then our bus-id is no longer valid and we need to
* destroy the backend device.
*/
+ DPRINTK("blkback_probe: failed to get frontend path and ID; "
+ "destroying backend device");
err = -ENOENT;
goto free_be;
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|