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] minios: Fix xenbus_unwatch_path calls

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] minios: Fix xenbus_unwatch_path calls
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 22 Nov 2009 23:36:03 -0800
Delivery-date: Sun, 22 Nov 2009 23:38:57 -0800
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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] minios: Fix xenbus_unwatch_path calls, Xen patchbot-unstable <=