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] Netfront must switch state using xenbus_switch_state() o

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Netfront must switch state using xenbus_switch_state() or this
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Apr 2006 10:14:19 +0000
Delivery-date: Tue, 11 Apr 2006 03:17:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID b32bc0c5648ddb111134b195a45ca12625c19fcf
# Parent  6df0bdcf8c9de75280cf40d8bf9583d343a6b41a
Netfront must switch state using xenbus_switch_state() or this
is not picked up by the waiting code in xenbus_probe.c.

Also clean up the waiting code a little.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 6df0bdcf8c9d -r b32bc0c5648d 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Mon Apr 10 
17:30:07 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Mon Apr 10 
17:56:34 2006
@@ -300,13 +300,6 @@
                goto abort_transaction;
        }
 
-       err = xenbus_printf(xbt, dev->nodename,
-                           "state", "%d", XenbusStateConnected);
-       if (err) {
-               message = "writing frontend XenbusStateConnected";
-               goto abort_transaction;
-       }
-
        err = xenbus_transaction_end(xbt, 0);
        if (err) {
                if (err == -EAGAIN)
@@ -314,6 +307,8 @@
                xenbus_dev_fatal(dev, err, "completing transaction");
                goto destroy_ring;
        }
+
+       xenbus_switch_state(dev, XenbusStateConnected);
 
        return 0;
 
diff -r 6df0bdcf8c9d -r b32bc0c5648d 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Mon Apr 10 
17:30:07 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Mon Apr 10 
17:56:34 2006
@@ -1065,19 +1065,16 @@
  */
 static int __init wait_for_devices(void)
 {
-       int i;
-
-       for (i = 0; i < 10 * HZ; i++) {
-               if (all_devices_ready()) {
-                       return;
-               }
-
-               set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout(1);
-       }
-
-       printk(KERN_WARNING
-              "XENBUS: Timeout connecting to devices!\n");
+       unsigned long timeout = jiffies + 10*HZ;
+
+       while (time_before(jiffies, timeout)) {
+               if (all_devices_ready())
+                       return 0;
+               schedule_timeout_interruptible(HZ/10);
+       }
+
+       printk(KERN_WARNING "XENBUS: Timeout connecting to devices!\n");
+       return 0;
 }
 
 late_initcall(wait_for_devices);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Netfront must switch state using xenbus_switch_state() or this, Xen patchbot -unstable <=