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

[Xen-changelog] [xen-unstable] minios: Fix xenbus_unwatch_path calls



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1258960918 0
# Node ID e10d641b413f85c09a360cc24bb78b7e07449d76
# Parent  8f4e0adc2b3b10dba27cbf62d1aee1842babf971
minios: Fix xenbus_unwatch_path calls

In a lot of places in MiniOS frontends, xenbus_watch_path_token is
used instead of xenbus_watch_path to get more precise wake ups.  To
free those, xenbus_unwatch_path_token has to be used instead of
xenbus_unwatch_path, else the unwatch operation will fail.  This fixes
spurious watch events left by pv-grub.

Signed-Off-By: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 extras/mini-os/blkfront.c             |    4 ++--
 extras/mini-os/console/xencons_ring.c |    2 +-
 extras/mini-os/fbfront.c              |   12 ++++++------
 extras/mini-os/fs-front.c             |    2 +-
 extras/mini-os/netfront.c             |    4 ++--
 extras/mini-os/pcifront.c             |    6 +++---
 6 files changed, 15 insertions(+), 15 deletions(-)

diff -r 8f4e0adc2b3b -r e10d641b413f extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Mon Nov 23 07:17:32 2009 +0000
+++ b/extras/mini-os/blkfront.c Mon Nov 23 07:21:58 2009 +0000
@@ -208,7 +208,7 @@ done:
             msg = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (msg != NULL || state != XenbusStateConnected) {
             printk("backend not available, state=%d\n", state);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
 
@@ -286,7 +286,7 @@ void shutdown_blkfront(struct blkfront_d
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
 
 close:
-    xenbus_unwatch_path(XBT_NIL, path);
+    xenbus_unwatch_path_token(XBT_NIL, path, path);
 
     snprintf(path, sizeof(path), "%s/ring-ref", nodename);
     xenbus_rm(XBT_NIL, path);
diff -r 8f4e0adc2b3b -r e10d641b413f extras/mini-os/console/xencons_ring.c
--- a/extras/mini-os/console/xencons_ring.c     Mon Nov 23 07:17:32 2009 +0000
+++ b/extras/mini-os/console/xencons_ring.c     Mon Nov 23 07:21:58 2009 +0000
@@ -312,7 +312,7 @@ done:
             msg = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (msg != NULL || state != XenbusStateConnected) {
             printk("backend not available, state=%d\n", state);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
     }
diff -r 8f4e0adc2b3b -r e10d641b413f extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c  Mon Nov 23 07:17:32 2009 +0000
+++ b/extras/mini-os/fbfront.c  Mon Nov 23 07:21:58 2009 +0000
@@ -165,7 +165,7 @@ done:
             err = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (state != XenbusStateConnected) {
             printk("backend not available, state=%d\n", state);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
 
@@ -175,7 +175,7 @@ done:
         if((err = xenbus_switch_state(XBT_NIL, frontpath, 
XenbusStateConnected))
             != NULL) {
             printk("error switching state: %s\n", err);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
     }
@@ -265,7 +265,7 @@ void shutdown_kbdfront(struct kbdfront_d
     //xenbus_wait_for_value(path, "2", &dev->events);
 
 close_kbdfront:
-    xenbus_unwatch_path(XBT_NIL, path);
+    xenbus_unwatch_path_token(XBT_NIL, path, path);
 
     snprintf(path, sizeof(path), "%s/page-ref", nodename);
     xenbus_rm(XBT_NIL, path);
@@ -513,7 +513,7 @@ done:
             err = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (state != XenbusStateConnected) {
             printk("backend not available, state=%d\n", state);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
 
@@ -526,7 +526,7 @@ done:
         if ((err = xenbus_switch_state(XBT_NIL, frontpath, 
XenbusStateConnected))
             != NULL) {
             printk("error switching state: %s\n", err);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
     }
@@ -644,7 +644,7 @@ void shutdown_fbfront(struct fbfront_dev
     //xenbus_wait_for_value(path, "2", &dev->events);
 
 close_fbfront:
-    xenbus_unwatch_path(XBT_NIL, path);
+    xenbus_unwatch_path_token(XBT_NIL, path, path);
 
     snprintf(path, sizeof(path), "%s/page-ref", nodename);
     xenbus_rm(XBT_NIL, path);
diff -r 8f4e0adc2b3b -r e10d641b413f extras/mini-os/fs-front.c
--- a/extras/mini-os/fs-front.c Mon Nov 23 07:17:32 2009 +0000
+++ b/extras/mini-os/fs-front.c Mon Nov 23 07:21:58 2009 +0000
@@ -1190,7 +1190,7 @@ done:
     /* The token will not be unique if multiple imports are inited */
     xenbus_watch_path_token(XBT_NIL, r_nodename, r_nodename, &events);
     xenbus_wait_for_value(r_nodename, STATE_READY, &events);
-    xenbus_unwatch_path(XBT_NIL, r_nodename);
+    xenbus_unwatch_path_token(XBT_NIL, r_nodename, r_nodename);
     printk("Backend ready.\n");
    
     //create_thread("fs-tester", test_fs_import, import); 
diff -r 8f4e0adc2b3b -r e10d641b413f extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c Mon Nov 23 07:17:32 2009 +0000
+++ b/extras/mini-os/netfront.c Mon Nov 23 07:21:58 2009 +0000
@@ -452,7 +452,7 @@ done:
             err = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (state != XenbusStateConnected) {
             printk("backend not avalable, state=%d\n", state);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
 
@@ -542,7 +542,7 @@ void shutdown_netfront(struct netfront_d
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
 
 close:
-    xenbus_unwatch_path(XBT_NIL, path);
+    xenbus_unwatch_path_token(XBT_NIL, path, path);
 
     snprintf(path, sizeof(path), "%s/tx-ring-ref", nodename);
     xenbus_rm(XBT_NIL, path);
diff -r 8f4e0adc2b3b -r e10d641b413f extras/mini-os/pcifront.c
--- a/extras/mini-os/pcifront.c Mon Nov 23 07:17:32 2009 +0000
+++ b/extras/mini-os/pcifront.c Mon Nov 23 07:21:58 2009 +0000
@@ -246,7 +246,7 @@ done:
             err = xenbus_wait_for_state_change(path, &state, &dev->events);
         if (state != XenbusStateConnected) {
             printk("backend not avalable, state=%d\n", state);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
 
@@ -254,7 +254,7 @@ done:
         if ((err = xenbus_switch_state(XBT_NIL, frontpath, 
XenbusStateConnected))
             != NULL) {
             printk("error switching state %s\n", err);
-            xenbus_unwatch_path(XBT_NIL, path);
+            xenbus_unwatch_path_token(XBT_NIL, path, path);
             goto error;
         }
     }
@@ -362,7 +362,7 @@ void shutdown_pcifront(struct pcifront_d
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
 
 close_pcifront:
-    xenbus_unwatch_path(XBT_NIL, path);
+    xenbus_unwatch_path_token(XBT_NIL, path, path);
 
     snprintf(path, sizeof(path), "%s/info-ref", nodename);
     xenbus_rm(XBT_NIL, path);

_______________________________________________
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®.