ia64/xen-unstable

changeset 11216:7258181ab445

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

Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
author kaf24@localhost.localdomain
date Sat Aug 19 10:21:02 2006 +0100 (2006-08-19)
parents 3fc16c39f15e
children b85da7cd9ea5
files linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Sat Aug 19 10:20:08 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Sat Aug 19 10:21:02 2006 +0100
     1.3 @@ -665,7 +665,17 @@ EXPORT_SYMBOL_GPL(unregister_xenbus_watc
     1.4  
     1.5  void xs_suspend(void)
     1.6  {
     1.7 +	struct xenbus_watch *watch;
     1.8 +	char token[sizeof(watch) * 2 + 1];
     1.9 +
    1.10  	down_write(&xs_state.suspend_mutex);
    1.11 +
    1.12 +	/* No need for watches_lock: the suspend_mutex is sufficient. */
    1.13 +	list_for_each_entry(watch, &watches, list) {
    1.14 +		sprintf(token, "%lX", (long)watch);
    1.15 +		xs_unwatch(watch->node, token);
    1.16 +	}
    1.17 +
    1.18  	mutex_lock(&xs_state.request_mutex);
    1.19  }
    1.20