WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Split talk_to_otherend into two pieces, one for getting

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Split talk_to_otherend into two pieces, one for getting the otherend details,
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Dec 2005 19:50:09 +0000
Delivery-date: Thu, 15 Dec 2005 19:52:25 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# 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@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Split talk_to_otherend into two pieces, one for getting the otherend details,, Xen patchbot -unstable <=