]> xenbits.xensource.com Git - people/royger/linux-2.6.18-xen.git/commitdiff
Don't register shutdown watch and suspend event channel for Dom0
authorKeir Fraser <keir@xen.org>
Tue, 16 Nov 2010 11:32:04 +0000 (11:32 +0000)
committerKeir Fraser <keir@xen.org>
Tue, 16 Nov 2010 11:32:04 +0000 (11:32 +0000)
This pointlessly consumes resources and poses the risk of either
getting triggered inadvertently.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/core/reboot.c

index 20a0e9e5fd6fcc4c75f34285af3f13c9224db41a..51ae7d8175bae7c340c90c514d3292e08e3ca2e1 100644 (file)
@@ -277,6 +277,15 @@ static int setup_shutdown_watcher(void)
 {
        int err;
 
+       err = register_xenbus_watch(&sysrq_watch);
+       if (err) {
+               printk(KERN_ERR "Failed to set sysrq watcher\n");
+               return err;
+       }
+
+       if (is_initial_xendomain())
+               return 0;
+
        xenbus_scanf(XBT_NIL, "control",
                     "platform-feature-multiprocessor-suspend",
                     "%d", &fast_suspend);
@@ -287,12 +296,6 @@ static int setup_shutdown_watcher(void)
                return err;
        }
 
-       err = register_xenbus_watch(&sysrq_watch);
-       if (err) {
-               printk(KERN_ERR "Failed to set sysrq watcher\n");
-               return err;
-       }
-
        /* suspend event channel */
        err = setup_suspend_evtchn();
        if (err) {