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] [xen-unstable] mini-os: Fix frontend shutdown wait loop

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] mini-os: Fix frontend shutdown wait loop
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 07 Apr 2010 02:20:20 -0700
Delivery-date: Wed, 07 Apr 2010 02:20:44 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1270624555 -3600
# Node ID 3895f8e0e63310e76a80e88ae31ccee2053ab8f2
# Parent  f46055ab176a33efa1677be500a4578f9ef113e2
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>
---
 extras/mini-os/blkfront.c |    2 +-
 extras/mini-os/fbfront.c  |   15 ++++++++++-----
 extras/mini-os/netfront.c |    2 +-
 extras/mini-os/pcifront.c |    2 +-
 4 files changed, 13 insertions(+), 8 deletions(-)

diff -r f46055ab176a -r 3895f8e0e633 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Wed Apr 07 08:15:33 2010 +0100
+++ b/extras/mini-os/blkfront.c Wed Apr 07 08:15:55 2010 +0100
@@ -289,7 +289,7 @@ void shutdown_blkfront(struct blkfront_d
         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 f46055ab176a -r 3895f8e0e633 extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c  Wed Apr 07 08:15:33 2010 +0100
+++ b/extras/mini-os/fbfront.c  Wed Apr 07 08:15:55 2010 +0100
@@ -262,7 +262,7 @@ void shutdown_kbdfront(struct kbdfront_d
         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 @@ void shutdown_kbdfront(struct kbdfront_d
                 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 @@ void shutdown_fbfront(struct fbfront_dev
                 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 f46055ab176a -r 3895f8e0e633 extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c Wed Apr 07 08:15:33 2010 +0100
+++ b/extras/mini-os/netfront.c Wed Apr 07 08:15:55 2010 +0100
@@ -546,7 +546,7 @@ void shutdown_netfront(struct netfront_d
         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 f46055ab176a -r 3895f8e0e633 extras/mini-os/pcifront.c
--- a/extras/mini-os/pcifront.c Wed Apr 07 08:15:33 2010 +0100
+++ b/extras/mini-os/pcifront.c Wed Apr 07 08:15:55 2010 +0100
@@ -354,7 +354,7 @@ void shutdown_pcifront(struct pcifront_d
         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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] mini-os: Fix frontend shutdown wait loop, Xen patchbot-unstable <=