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-api

[Xen-API] [PATCH 2 of 4] CA-33707: fix bug where the xenstore watching c

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [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
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 10 Dec 2009 23:04:56 +0000
Delivery-date: Thu, 10 Dec 2009 15:07:38 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1260486294@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# 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