WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Allow shutdown code SHUTDOWN_HALT, which we handle here

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Allow shutdown code SHUTDOWN_HALT, which we handle here in exactly the same
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Oct 2005 10:16:12 +0000
Delivery-date: Thu, 06 Oct 2005 10:14:02 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID 4ab4f023a6ce08999a4d64937b3206fef163c62c
# Parent  0bc466c255605d0efeb4803626b72415839b9e6c
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@xxxxxxxxxxxxx>

diff -r 0bc466c25560 -r 4ab4f023a6ce 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Thu Oct  6 10:09:14 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Thu Oct  6 10:11:16 2005
@@ -20,6 +20,12 @@
 #define SHUTDOWN_POWEROFF  0
 #define SHUTDOWN_REBOOT    1
 #define SHUTDOWN_SUSPEND   2
+// Code 3 is SHUTDOWN_CRASH, which we don't use because the domain can only
+// report a crash, not be instructed to crash!
+// HALT is the same as POWEROFF, as far as we're concerned.  The tools use
+// the distinction when we return the reason code to them.
+#define SHUTDOWN_HALT      4
+
 
 void machine_restart(char * __unused)
 {
@@ -213,6 +219,7 @@
 
        switch (shutting_down) {
        case SHUTDOWN_POWEROFF:
+       case SHUTDOWN_HALT:
                if (execve("/sbin/poweroff", poweroff_argv, envp) < 0) {
                        sys_reboot(LINUX_REBOOT_MAGIC1,
                                   LINUX_REBOOT_MAGIC2,
@@ -294,6 +301,8 @@
                shutting_down = SHUTDOWN_REBOOT;
        else if (strcmp(str, "suspend") == 0)
                shutting_down = SHUTDOWN_SUSPEND;
+       else if (strcmp(str, "halt") == 0)
+               shutting_down = SHUTDOWN_HALT;
        else {
                printk("Ignoring shutdown request: %s\n", str);
                shutting_down = SHUTDOWN_INVALID;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Allow shutdown code SHUTDOWN_HALT, which we handle here in exactly the same, Xen patchbot -unstable <=