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 06/11] xen/hvm kexec: unregister shutdown+sysrq watch

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 06/11] xen/hvm kexec: unregister shutdown+sysrq watches during reboot
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 28 Jul 2011 15:23:06 +0200
Delivery-date: Thu, 28 Jul 2011 06:25:40 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311859384; l=1474; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=WTn8NjRyvaWIz6ENZDp6OQr8vg0=; b=t7XebkaGUOS5VIk8oiokcikpOsocVqouN+c3mWiviJlBvlteOMxcfK5ZqFXeGf5bBXD KN99yaQTCR7mQxpEdFqM9u226demXWFqcw6NfiMBcFDw5ihUY/04uMcpDY9aub3NjFIGn 8DS5BGBr+axhdzHhzwivVL0IpoOKYIzgVv4=
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 shutdown and sysrq watch during kexec.  The watches can
not be re-registered in the kexec kernel because they are still seen as
busy by xenstore.

v2:
 use kexec_is_loaded() function

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

---
 drivers/xen/manage.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Index: linux-3.0/drivers/xen/manage.c
===================================================================
--- linux-3.0.orig/drivers/xen/manage.c
+++ linux-3.0/drivers/xen/manage.c
@@ -8,6 +8,7 @@
 #include <linux/sysrq.h>
 #include <linux/stop_machine.h>
 #include <linux/freezer.h>
+#include <linux/kexec.h>
 #include <linux/syscore_ops.h>
 
 #include <xen/xen.h>
@@ -320,6 +321,21 @@ static int shutdown_event(struct notifie
        return NOTIFY_DONE;
 }
 
+static void xenbus_manage_shutdown_watcher(void)
+{
+       if (!kexec_is_loaded())
+               return;
+
+       unregister_xenbus_watch(&shutdown_watch);
+#ifdef CONFIG_MAGIC_SYSRQ
+       unregister_xenbus_watch(&sysrq_watch);
+#endif
+}
+
+static struct syscore_ops xenbus_manage_watcher_syscore_ops = {
+       .shutdown = xenbus_manage_shutdown_watcher,
+};
+
 int xen_setup_shutdown_event(void)
 {
        static struct notifier_block xenstore_notifier = {
@@ -329,6 +345,7 @@ int xen_setup_shutdown_event(void)
        if (!xen_domain())
                return -ENODEV;
        register_xenstore_notifier(&xenstore_notifier);
+       register_syscore_ops(&xenbus_manage_watcher_syscore_ops);
 
        return 0;
 }


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