From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: [patch 4/6] xenbus: suspend correctly Date: Thu, 17 Aug 2006 15:52:22 +0200 Message-ID: <44E47496.5040608@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010303090400010702060900" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen devel list List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010303090400010702060900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 -- Gerd Hoffmann http://www.suse.de/~kraxel/julika-dora.jpeg --------------010303090400010702060900 Content-Type: text/plain; name="xenbus-suspend" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xenbus-suspend" Signed-off-by: Gerd Hoffmann Index: source-lnx-stable-22813/drivers/xen/xenbus/xenbus_xs.c =================================================================== --- source-lnx-stable-22813.orig/drivers/xen/xenbus/xenbus_xs.c 2006-08-17 15:19:20.000000000 +0200 +++ source-lnx-stable-22813/drivers/xen/xenbus/xenbus_xs.c 2006-08-17 15:20:17.000000000 +0200 @@ -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); } --------------010303090400010702060900 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010303090400010702060900--