Mailing List Archive

Split talk_to_otherend into two pieces, one for getting the otherend details,
# HG changeset patch
# User emellor@leeni.uk.xensource.com
# Node ID b62e324574d2acba81a4e61c9b55e4e7c8918920
# Parent bbe553187504b68a5caac60979b3002303384cdf
Split talk_to_otherend into two pieces, one for getting the otherend details,
and one for registering the watch on the otherend's path. This means that we
get the fix intended by xen-unstable changeset 8370:39a616126104 (i.e. we only
register the watch once drv->probe() has succeeded), but without breaking block
devices.

Signed-off-by: Ewan Mellor <ewan@xensource.com>

diff -r bbe553187504 -r b62e324574d2 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Thu Dec 15 13:55:05 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Thu Dec 15 18:38:49 2005
@@ -315,15 +315,16 @@
static int talk_to_otherend(struct xenbus_device *dev)
{
struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver);
- int err;

free_otherend_watch(dev);
free_otherend_details(dev);

- err = drv->read_otherend_details(dev);
- if (err)
- return err;
-
+ return drv->read_otherend_details(dev);
+}
+
+
+static int watch_otherend(struct xenbus_device *dev)
+{
return xenbus_watch_path2(dev, dev->otherend, "state",
&dev->otherend_watch, otherend_changed);
}
@@ -349,14 +350,22 @@
goto fail;
}

- err = drv->probe(dev, id);
- if (err)
- goto fail;
-
err = talk_to_otherend(dev);
if (err) {
printk(KERN_WARNING
"xenbus_probe: talk_to_otherend on %s failed.\n",
+ dev->nodename);
+ return err;
+ }
+
+ err = drv->probe(dev, id);
+ if (err)
+ goto fail;
+
+ err = watch_otherend(dev);
+ if (err) {
+ printk(KERN_WARNING
+ "xenbus_probe: watch_otherend on %s failed.\n",
dev->nodename);
return err;
}
@@ -826,6 +835,14 @@
return err;
}

+ err = watch_otherend(xdev);
+ if (err) {
+ printk(KERN_WARNING
+ "xenbus_probe: resume (watch_otherend) %s failed: "
+ "%d.\n", dev->bus_id, err);
+ return err;
+ }
+
if (drv->resume)
err = drv->resume(xdev);
if (err)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog