[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] xenbus: Improvements to wait_for_devices().



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1185366573 -3600
# Node ID 726cd201f4cde2be30657ee8690bc8e47260eb6a
# Parent  3b0bce92b2f254242c785d2662776e04a0817301
xenbus: Improvements to wait_for_devices().
 1. When printing a warning about a timed-out device, print the
 current state of both ends of the device connection (i.e., backend as
 well as frontend).
 2. A device is 'not yet connected' only when the local state is *less
 than* XenbusStateConnected. If the state is Closing or Closed
 (usually because of an explicit failure when trying to make the
 connection) then we should not wait for the connection to occur -- it
 will never happen!

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 drivers/xen/xenbus/xenbus_probe.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff -r 3b0bce92b2f2 -r 726cd201f4cd drivers/xen/xenbus/xenbus_probe.c
--- a/drivers/xen/xenbus/xenbus_probe.c Tue Jul 24 17:09:09 2007 +0100
+++ b/drivers/xen/xenbus/xenbus_probe.c Wed Jul 25 13:29:33 2007 +0100
@@ -1034,7 +1034,7 @@ static int is_disconnected_device(struct
                return 0;
 
        xendrv = to_xenbus_driver(dev->driver);
-       return (xendev->state != XenbusStateConnected ||
+       return (xendev->state < XenbusStateConnected ||
                (xendrv->is_ready && !xendrv->is_ready(xendev)));
 }
 
@@ -1059,10 +1059,13 @@ static int print_device_status(struct de
                /* Information only: is this too noisy? */
                printk(KERN_INFO "XENBUS: Device with no driver: %s\n",
                       xendev->nodename);
-       } else if (xendev->state != XenbusStateConnected) {
+       } else if (xendev->state < XenbusStateConnected) {
+               enum xenbus_state rstate = XenbusStateUnknown;
+               if (xendev->otherend)
+                       rstate = xenbus_read_driver_state(xendev->otherend);
                printk(KERN_WARNING "XENBUS: Timeout connecting "
-                      "to device: %s (state %d)\n",
-                      xendev->nodename, xendev->state);
+                      "to device: %s (local state %d, remote state %d)\n",
+                      xendev->nodename, xendev->state, rstate);
        }
 
        return 0;

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.