[LINUX] Call ctrl_alt_del() to trigger a reboot so we benefit from the
authorIan Campbell <ian.campbell@xensource.com>
Tue, 13 Feb 2007 15:32:25 +0000 (15:32 +0000)
committerIan Campbell <ian.campbell@xensource.com>
Tue, 13 Feb 2007 15:32:25 +0000 (15:32 +0000)
generic infrastructure for cad_pid etc.

Add a ctrl_alt_del() implemenation to the PV on HVM compatibility
layer since ctrl_alt_del() is not exported on native kernels.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
linux-2.6-xen-sparse/drivers/xen/core/reboot.c
unmodified_drivers/linux-2.6/platform-pci/platform-compat.c

index af3fe3a15c5a7caa6705c24f83ef04ff7233eaa2..aab244a73816b24fb501dc554db5eb31f5e11bc6 100644 (file)
@@ -100,6 +100,7 @@ static void __shutdown_handler(void *unused)
 static void shutdown_handler(struct xenbus_watch *watch,
                             const char **vec, unsigned int len)
 {
+       extern void ctrl_alt_del(void);
        char *str;
        struct xenbus_transaction xbt;
        int err;
@@ -129,7 +130,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
        if (strcmp(str, "poweroff") == 0)
                shutting_down = SHUTDOWN_POWEROFF;
        else if (strcmp(str, "reboot") == 0)
-               kill_proc(1, SIGINT, 1); /* interrupt init */
+               ctrl_alt_del();
        else if (strcmp(str, "suspend") == 0)
                shutting_down = SHUTDOWN_SUSPEND;
        else if (strcmp(str, "halt") == 0)
index 5a0bb9bce81ace6f2b3a3c6d0d0cac8478671764..7e1ad1f169a197178d476586759e1fac7424c356 100644 (file)
@@ -13,6 +13,12 @@ static int system_state = 1;
 EXPORT_SYMBOL(system_state);
 #endif
 
+static inline void ctrl_alt_del(void)
+{
+       kill_proc(1, SIGINT, 1); /* interrupt init */
+}
+EXPORT_SYMBOL(ctrl_alt_del);
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
 size_t strcspn(const char *s, const char *reject)
 {