Skip to contentSkip to conversation

xenbus: suspend correctly

PATCH In review Gerd Hoffmann 1 participant 1 message Aug 17, 2006 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 xenbus: suspend correctly

Hi,

Cleanup correctly on suspend, unregister watches.
Again needed for domU kexec, so the next kernel instance can register watches without running into -EBUSY.

cheers,
Gerd

Signature · 2 lines
Gerd Hoffmann <[email protected]>
http://www.suse.de/~kraxel/julika-dora.jpeg
drivers/xen/xenbus/xenbus_xs.c +10 -0
Index: source-lnx-stable-22813/drivers/xen/xenbus/xenbus_xs.c
===================================================================
@@ -665,7 +665,17 @@ EXPORT_SYMBOL_GPL(unregister_xenbus_watc
 
 void xs_suspend(void)
 {
+	struct xenbus_watch *watch;
+	char token[sizeof(watch) * 2 + 1];
+
 	down_write(&xs_state.suspend_mutex);
+
+	/* No need for watches_lock: the suspend_mutex is sufficient. */
+	list_for_each_entry(watch, &watches, list) {
+		sprintf(token, "%lX", (long)watch);
+		xs_unwatch(watch->node, token);
+	}
+
 	mutex_lock(&xs_state.request_mutex);
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel