Small cleanup to shutdown codes.
Signed-off-by: Keir Fraser <keir@xensource.com>
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();
}
if ( reason == SHUTDOWN_crash )
- domain_crash(); /* we will not return */
+ {
+ domain_crash();
+ BUG();
+ }
current->shutdown_code = reason;
set_bit(DF_SHUTDOWN, ¤t->flags);
#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.
*/
#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().
*/