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

[Xen-API] [PATCH 2 of 4] CA-33707: fix bug where the xenstore watching code would fail with Xb EEXIST if the same path was in the watch list multiple times



# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1260486288 0
# Node ID 90cd62326033db94c84c9c8f607f27335e3c76c4
# Parent  43f67984ff0f3737bc3c041325446ec5fcd27a6e
CA-33707: fix bug where the xenstore watching code would fail with Xb EEXIST if 
the same path was in the watch list multiple times.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 43f67984ff0f -r 90cd62326033 ocaml/xenops/watch.ml
--- a/ocaml/xenops/watch.ml     Thu Dec 10 23:04:47 2009 +0000
+++ b/ocaml/xenops/watch.ml     Thu Dec 10 23:04:48 2009 +0000
@@ -49,14 +49,15 @@
     | KeepWaiting -> false
     | Result x -> result := Some x; true in
   try
-    debug "watch: watching xenstore paths: [ %s ] with timeout %f seconds" 
(String.concat "; " x.paths) timeout;
+       let paths = Listext.List.setify x.paths in
+    debug "watch: watching xenstore paths: [ %s ] with timeout %f seconds" 
(String.concat "; " paths) timeout;
     (* If the list of paths is empty then we don't receive /any/ watch events 
and so
        we'll always block until the timeout. If the condition depends on no 
xenstore paths
        then we can consider it to be vacuously true (or a bug if the condition 
fn evaluates
        to false). Note this code is required in order to migrate diskless VMs: 
CA-15011 *)
     if x.paths = [] 
     then ignore(callback ("/", "X"))
-    else Xs.monitor_paths xs (List.map (fun path -> path, "X") x.paths) 
timeout callback;
+    else Xs.monitor_paths xs (List.map (fun path -> path, "X") paths) timeout 
callback;
       begin match !result with
       | Some x -> 
          x
1 file changed, 3 insertions(+), 2 deletions(-)
ocaml/xenops/watch.ml |    5 +++--


Attachment: xen-api.hg-4.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.