WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 07/11] xen/hvm kexec: unregister memory/target watch

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 07/11] xen/hvm kexec: unregister memory/target watch in xen-balloon.c
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 28 Jul 2011 15:23:07 +0200
Delivery-date: Thu, 28 Jul 2011 06:31:28 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311859403; l=1417; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=3KrSuathm392ppEbtzhK5JGJzLk=; b=U9hMHZ4hRm3NmlqJRkX+LrYovoXLksXfA9cCzzPJUVQKgohwuD+ANaPhxZPhHAebHw9 U0iCCBM63w8RSRHANWWnDxtBmxEFoCQmIJAA2ianPKFT3XvxeuKjQDnxngD1KM+mF+ybE xwpNh15/IdrD1f6Jf5SUzm4xHc1t07WsFy8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110728132300.248098023@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-16.4
Unregister the memory/target watch during kexec. The watche can not be
re-registered in the kexec kernel because it is still seen as busy by
xenstore.

v2:
 use kexec_is_loaded() function

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 drivers/xen/xen-balloon.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

Index: linux-3.0/drivers/xen/xen-balloon.c
===================================================================
--- linux-3.0.orig/drivers/xen/xen-balloon.c
+++ linux-3.0/drivers/xen/xen-balloon.c
@@ -34,6 +34,8 @@
 #include <linux/module.h>
 #include <linux/sysdev.h>
 #include <linux/capability.h>
+#include <linux/kexec.h>
+#include <linux/syscore_ops.h>
 
 #include <xen/xen.h>
 #include <xen/interface/xen.h>
@@ -91,6 +93,18 @@ static struct notifier_block xenstore_no
        .notifier_call = balloon_init_watcher,
 };
 
+static void xen_balloon_shutdown_watcher(void)
+{
+       if (!kexec_is_loaded())
+               return;
+
+       unregister_xenbus_watch(&target_watch);
+}
+
+static struct syscore_ops xen_balloon_watcher_syscore_ops = {
+       .shutdown = xen_balloon_shutdown_watcher,
+};
+
 static int __init balloon_init(void)
 {
        if (!xen_domain())
@@ -100,6 +114,7 @@ static int __init balloon_init(void)
 
        register_balloon(&balloon_sysdev);
        register_xenstore_notifier(&xenstore_notifier);
+       register_syscore_ops(&xen_balloon_watcher_syscore_ops);
 
        return 0;
 }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>