diff options
author | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-08-17 10:18:34 +0000 |
---|---|---|
committer | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-08-17 10:18:34 +0000 |
commit | f9c5a6235f538ea0b0aebd12ab851c88f986cd38 (patch) | |
tree | 770cb9d4b02509cdc62b7ea105f365e117fe88b8 | |
parent | 6b2e5410964d72f8ee8b99e268f2c8b90bac7751 (diff) | |
download | xen-f9c5a6235f538ea0b0aebd12ab851c88f986cd38.tar.gz xen-f9c5a6235f538ea0b0aebd12ab851c88f986cd38.tar.bz2 xen-f9c5a6235f538ea0b0aebd12ab851c88f986cd38.zip |
Recreate watches on domain restore.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c | 1 | ||||
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c | 12 | ||||
-rw-r--r-- | linux-2.6-xen-sparse/include/asm-xen/xenbus.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index e5c625d752..63923361a1 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -309,6 +309,7 @@ void xenbus_suspend(void) void xenbus_resume(void) { xb_init_comms(); + reregister_xenbus_watches(); up(&xenbus_lock); } diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c index 211677b35d..2e9c79361d 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c @@ -496,6 +496,18 @@ void unregister_xenbus_watch(struct xenbus_watch *watch) 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 --git a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h index 8e9593ff90..8ffbcb75ef 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h +++ b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h @@ -121,6 +121,7 @@ void unregister_xenstore_notifier(struct notifier_block *nb); 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); |