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-devel

[Xen-devel] [PATCH] mini-os: Fix frontend shutdown wait loop

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] mini-os: Fix frontend shutdown wait loop
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Date: Tue, 6 Apr 2010 22:36:54 +0200
Delivery-date: Tue, 06 Apr 2010 13:37:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
mini-os: Fix frontend shutdown wait loop

minios frontends must wait for backends to be shut down and
reinitialized before freeing resources.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

diff -r adce8bc43fcc extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/blkfront.c Tue Apr 06 22:35:30 2010 +0200
@@ -289,7 +289,7 @@
         goto close;
     }
     state = xenbus_read_integer(path);
-    if (state < XenbusStateClosed) {
+    while (state < XenbusStateClosed) {
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (err) free(err);
     }
diff -r adce8bc43fcc extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c  Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/fbfront.c  Tue Apr 06 22:35:30 2010 +0200
@@ -262,7 +262,7 @@
         goto close_kbdfront;
     }
     state = xenbus_read_integer(path);
-    if (state < XenbusStateClosed) {
+    while (state < XenbusStateClosed) {
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (err) free(err);
     }
@@ -272,8 +272,10 @@
                 XenbusStateInitialising, err);
         goto close_kbdfront;
     }
-    // does not work yet.
-    //xenbus_wait_for_value(path, "2", &dev->events);
+    err = NULL;
+    state = xenbus_read_integer(path);
+    while (err == NULL && (state < XenbusStateInitWait || state >= 
XenbusStateClosed))
+    err = xenbus_wait_for_state_change(path, &state, &dev->events);
 
 close_kbdfront:
     if (err) free(err);
@@ -660,8 +662,11 @@
                 XenbusStateInitialising, err);
         goto close_fbfront;
     }
-    // does not work yet
-    //xenbus_wait_for_value(path, "2", &dev->events);
+
+    err = NULL;
+    state = xenbus_read_integer(path);
+    while (err == NULL && (state < XenbusStateInitWait || state >= 
XenbusStateClosed))
+        err = xenbus_wait_for_state_change(path, &state, &dev->events);
 
 close_fbfront:
     if (err) free(err);
diff -r adce8bc43fcc extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/netfront.c Tue Apr 06 22:35:30 2010 +0200
@@ -546,7 +546,7 @@
         goto close;
     }
     state = xenbus_read_integer(path);
-    if (state < XenbusStateClosed) {
+    while (state < XenbusStateClosed) {
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (err) free(err);
     }
diff -r adce8bc43fcc extras/mini-os/pcifront.c
--- a/extras/mini-os/pcifront.c Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/pcifront.c Tue Apr 06 22:35:30 2010 +0200
@@ -354,7 +354,7 @@
         goto close_pcifront;
     }
     state = xenbus_read_integer(path);
-    if (state < XenbusStateClosed) {
+    while (state < XenbusStateClosed) {
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
         free(err);
     }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] mini-os: Fix frontend shutdown wait loop, Samuel Thibault <=