aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-08-17 10:18:34 +0000
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-08-17 10:18:34 +0000
commitf9c5a6235f538ea0b0aebd12ab851c88f986cd38 (patch)
tree770cb9d4b02509cdc62b7ea105f365e117fe88b8
parent6b2e5410964d72f8ee8b99e268f2c8b90bac7751 (diff)
downloadxen-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.c1
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c12
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/xenbus.h1
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);