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

[Xen-changelog] Recreate watches on domain restore.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 8203b7d536d32cb27f810db478e58ae57faa446c
# Parent  27a4a073fc753d8410424c261bc06699573fe1c8
Recreate watches on domain restore.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 27a4a073fc75 -r 8203b7d536d3 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Wed Aug 17 
10:18:13 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Wed Aug 17 
10:18:34 2005
@@ -309,6 +309,7 @@
 void xenbus_resume(void)
 {
        xb_init_comms();
+       reregister_xenbus_watches();
        up(&xenbus_lock);
 }
 
diff -r 27a4a073fc75 -r 8203b7d536d3 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Wed Aug 17 
10:18:13 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Wed Aug 17 
10:18:34 2005
@@ -496,6 +496,18 @@
                       watch->node, err);
 }
 
+/* Re-register callbacks to all watches. */
+void reregister_xenbus_watches(void)
+{
+       struct xenbus_watch *watch;
+       char token[sizeof(watch) * 2 + 1];
+
+       list_for_each_entry(watch, &watches, list) {
+               sprintf(token, "%lX", (long)watch);
+               xs_watch(watch->node, token);
+       }
+}
+
 static int watch_thread(void *unused)
 {
        for (;;) {
diff -r 27a4a073fc75 -r 8203b7d536d3 
linux-2.6-xen-sparse/include/asm-xen/xenbus.h
--- a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h     Wed Aug 17 10:18:13 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h     Wed Aug 17 10:18:34 2005
@@ -121,6 +121,7 @@
 
 int register_xenbus_watch(struct xenbus_watch *watch);
 void unregister_xenbus_watch(struct xenbus_watch *watch);
+void reregister_xenbus_watches(void);
 
 /* Called from xen core code. */
 void xenbus_suspend(void);

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