ia64/xen-unstable

changeset 13908:df25547d7638

[LINUX] Call ctrl_alt_del() to trigger a reboot so we benefit from the
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>
author Ian Campbell <ian.campbell@xensource.com>
date Tue Feb 13 15:32:25 2007 +0000 (2007-02-13)
parents ad9bbd103034
children 6daa91dc9247
files linux-2.6-xen-sparse/drivers/xen/core/reboot.c unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c	Fri Feb 09 18:19:24 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c	Tue Feb 13 15:32:25 2007 +0000
     1.3 @@ -100,6 +100,7 @@ static void __shutdown_handler(void *unu
     1.4  static void shutdown_handler(struct xenbus_watch *watch,
     1.5  			     const char **vec, unsigned int len)
     1.6  {
     1.7 +	extern void ctrl_alt_del(void);
     1.8  	char *str;
     1.9  	struct xenbus_transaction xbt;
    1.10  	int err;
    1.11 @@ -129,7 +130,7 @@ static void shutdown_handler(struct xenb
    1.12  	if (strcmp(str, "poweroff") == 0)
    1.13  		shutting_down = SHUTDOWN_POWEROFF;
    1.14  	else if (strcmp(str, "reboot") == 0)
    1.15 -		kill_proc(1, SIGINT, 1); /* interrupt init */
    1.16 +		ctrl_alt_del();
    1.17  	else if (strcmp(str, "suspend") == 0)
    1.18  		shutting_down = SHUTDOWN_SUSPEND;
    1.19  	else if (strcmp(str, "halt") == 0)
     2.1 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c	Fri Feb 09 18:19:24 2007 +0000
     2.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c	Tue Feb 13 15:32:25 2007 +0000
     2.3 @@ -13,6 +13,12 @@ static int system_state = 1;
     2.4  EXPORT_SYMBOL(system_state);
     2.5  #endif
     2.6  
     2.7 +static inline void ctrl_alt_del(void)
     2.8 +{
     2.9 +	kill_proc(1, SIGINT, 1); /* interrupt init */
    2.10 +}
    2.11 +EXPORT_SYMBOL(ctrl_alt_del);
    2.12 +
    2.13  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
    2.14  size_t strcspn(const char *s, const char *reject)
    2.15  {