# HG changeset patch # User David Scott # 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 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