ia64/xen-unstable

changeset 4123:108ea6682e8a

bitkeeper revision 1.1159.258.53 (423408f115Ns6FbhmO7JTOAWVZjwog)

Small cleanup to shutdown codes.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@scramble.cl.cam.ac.uk
date Sun Mar 13 09:33:37 2005 +0000 (2005-03-13)
parents 62fcb87e60f6
children d4fa637dbd23 3d1f6ffaa1de
files xen/common/domain.c xen/include/public/io/domain_controller.h xen/include/public/xen.h
line diff
     1.1 --- a/xen/common/domain.c	Sun Mar 13 01:36:29 2005 +0000
     1.2 +++ b/xen/common/domain.c	Sun Mar 13 09:33:37 2005 +0000
     1.3 @@ -157,7 +157,7 @@ void domain_shutdown(u8 reason)
     1.4          extern void machine_restart(char *);
     1.5          extern void machine_halt(void);
     1.6  
     1.7 -        if ( reason == 0 ) 
     1.8 +        if ( reason == SHUTDOWN_poweroff ) 
     1.9          {
    1.10              printk("Domain 0 halted: halting machine.\n");
    1.11              machine_halt();
    1.12 @@ -170,7 +170,10 @@ void domain_shutdown(u8 reason)
    1.13      }
    1.14  
    1.15      if ( reason == SHUTDOWN_crash )
    1.16 -        domain_crash();  /* we will not return */  
    1.17 +    {
    1.18 +        domain_crash();
    1.19 +        BUG();
    1.20 +    }
    1.21  
    1.22      current->shutdown_code = reason;
    1.23      set_bit(DF_SHUTDOWN, &current->flags);
     2.1 --- a/xen/include/public/io/domain_controller.h	Sun Mar 13 01:36:29 2005 +0000
     2.2 +++ b/xen/include/public/io/domain_controller.h	Sun Mar 13 09:33:37 2005 +0000
     2.3 @@ -10,17 +10,6 @@
     2.4  #ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
     2.5  #define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
     2.6  
     2.7 -
     2.8 -/*
     2.9 - * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
    2.10 - * interpreted by control software to determine the appropriate action. These 
    2.11 - * are only really advisories: the controller can actually do as it likes.
    2.12 - */
    2.13 -#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
    2.14 -#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
    2.15 -#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
    2.16 -#define SHUTDOWN_crash      3  /* Tell controler we've crashed.              */
    2.17 -
    2.18  /*
    2.19   * CONTROLLER MESSAGING INTERFACE.
    2.20   */
     3.1 --- a/xen/include/public/xen.h	Sun Mar 13 01:36:29 2005 +0000
     3.2 +++ b/xen/include/public/xen.h	Sun Mar 13 09:33:37 2005 +0000
     3.3 @@ -177,6 +177,16 @@
     3.4  #define SCHEDOP_reasonshift     8   /* 8-bit reason code. (SCHEDOP_shutdown) */
     3.5  
     3.6  /*
     3.7 + * Reason codes for SCHEDOP_shutdown. These may be interpreted by control 
     3.8 + * software to determine the appropriate action. For the most part, Xen does
     3.9 + * not care about the shutdown code (SHUTDOWN_crash excepted).
    3.10 + */
    3.11 +#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
    3.12 +#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
    3.13 +#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
    3.14 +#define SHUTDOWN_crash      3  /* Tell controller we've crashed.             */
    3.15 +
    3.16 +/*
    3.17   * Commands to HYPERVISOR_console_io().
    3.18   */
    3.19  #define CONSOLEIO_write         0