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

[Xen-changelog] Added an unwatch method, so that XendDomainInfo can unregister the watch from



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 3631592ad7d3acf193eb0b0ae39f81169881b14b
# Parent  8c736c042f727fb4d6c0471ed3ff6d60cb68964e
Added an unwatch method, so that XendDomainInfo can unregister the watch from
outside the watch handler.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 8c736c042f72 -r 3631592ad7d3 tools/python/xen/xend/xenstore/xswatch.py
--- a/tools/python/xen/xend/xenstore/xswatch.py Wed Nov 16 14:27:11 2005
+++ b/tools/python/xen/xend/xenstore/xswatch.py Wed Nov 16 14:27:59 2005
@@ -20,6 +20,10 @@
         self.kwargs = kwargs
         watchStart()
         xs.watch(path, self)
+
+
+    def unwatch(self):
+        xs.unwatch(self.path, self)
 
 
 watchThread = None
@@ -49,7 +53,7 @@
             watch = we[1]
             res = watch.fn(*watch.args, **watch.kwargs)
             if not res:
-                xs.unwatch(watch.path, watch)
+                watch.unwatch()
         except:
             log.exception("read_watch failed")
             # Ignore this exception -- there's no point throwing it

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