ia64/xen-unstable

changeset 7242:4ab4f023a6ce

Allow shutdown code SHUTDOWN_HALT, which we handle here in exactly the same
way as POWEROFF. The tools use the distinction when the code is returned.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 11:11:16 2005 +0100 (2005-10-06)
parents 0bc466c25560
children bd37123974b2
files linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Thu Oct 06 11:09:14 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Thu Oct 06 11:11:16 2005 +0100
     1.3 @@ -20,6 +20,12 @@
     1.4  #define SHUTDOWN_POWEROFF  0
     1.5  #define SHUTDOWN_REBOOT    1
     1.6  #define SHUTDOWN_SUSPEND   2
     1.7 +// Code 3 is SHUTDOWN_CRASH, which we don't use because the domain can only
     1.8 +// report a crash, not be instructed to crash!
     1.9 +// HALT is the same as POWEROFF, as far as we're concerned.  The tools use
    1.10 +// the distinction when we return the reason code to them.
    1.11 +#define SHUTDOWN_HALT      4
    1.12 +
    1.13  
    1.14  void machine_restart(char * __unused)
    1.15  {
    1.16 @@ -213,6 +219,7 @@ static int shutdown_process(void *__unus
    1.17  
    1.18  	switch (shutting_down) {
    1.19  	case SHUTDOWN_POWEROFF:
    1.20 +	case SHUTDOWN_HALT:
    1.21  		if (execve("/sbin/poweroff", poweroff_argv, envp) < 0) {
    1.22  			sys_reboot(LINUX_REBOOT_MAGIC1,
    1.23  				   LINUX_REBOOT_MAGIC2,
    1.24 @@ -294,6 +301,8 @@ static void shutdown_handler(struct xenb
    1.25  		shutting_down = SHUTDOWN_REBOOT;
    1.26  	else if (strcmp(str, "suspend") == 0)
    1.27  		shutting_down = SHUTDOWN_SUSPEND;
    1.28 +	else if (strcmp(str, "halt") == 0)
    1.29 +		shutting_down = SHUTDOWN_HALT;
    1.30  	else {
    1.31  		printk("Ignoring shutdown request: %s\n", str);
    1.32  		shutting_down = SHUTDOWN_INVALID;