]> xenbits.xensource.com Git - xen.git/commitdiff
bitkeeper revision 1.1159.258.53 (423408f115Ns6FbhmO7JTOAWVZjwog)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Sun, 13 Mar 2005 09:33:37 +0000 (09:33 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Sun, 13 Mar 2005 09:33:37 +0000 (09:33 +0000)
Small cleanup to shutdown codes.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/domain.c
xen/include/public/io/domain_controller.h
xen/include/public/xen.h

index f04e8bdfc77f565b10382a11cf4242c9ccce8514..fa07f2baf9f4ac42df7080e837ad28aa69468af5 100644 (file)
@@ -157,7 +157,7 @@ void domain_shutdown(u8 reason)
         extern void machine_restart(char *);
         extern void machine_halt(void);
 
-        if ( reason == 0 ) 
+        if ( reason == SHUTDOWN_poweroff ) 
         {
             printk("Domain 0 halted: halting machine.\n");
             machine_halt();
@@ -170,7 +170,10 @@ void domain_shutdown(u8 reason)
     }
 
     if ( reason == SHUTDOWN_crash )
-        domain_crash();  /* we will not return */  
+    {
+        domain_crash();
+        BUG();
+    }
 
     current->shutdown_code = reason;
     set_bit(DF_SHUTDOWN, &current->flags);
index 8415132d45d864bd7f7b4388d9044c6e4cc3d90d..c3494e34ca07aae8a60e38a03ed3d695c2961ce4 100644 (file)
 #ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
 #define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
 
-
-/*
- * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
- * interpreted by control software to determine the appropriate action. These 
- * are only really advisories: the controller can actually do as it likes.
- */
-#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
-#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
-#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
-#define SHUTDOWN_crash      3  /* Tell controler we've crashed.              */
-
 /*
  * CONTROLLER MESSAGING INTERFACE.
  */
index ff13c0fb2011e5fbe543f38e155655d44d2450a7..f226416a94d25b8de7602305382cd1e2e1f03669 100644 (file)
 #define SCHEDOP_cmdmask       255   /* 8-bit command. */
 #define SCHEDOP_reasonshift     8   /* 8-bit reason code. (SCHEDOP_shutdown) */
 
+/*
+ * Reason codes for SCHEDOP_shutdown. These may be interpreted by control 
+ * software to determine the appropriate action. For the most part, Xen does
+ * not care about the shutdown code (SHUTDOWN_crash excepted).
+ */
+#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
+#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
+#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
+#define SHUTDOWN_crash      3  /* Tell controller we've crashed.             */
+
 /*
  * Commands to HYPERVISOR_console_io().
  */