Skip to contentSkip to conversation

fix reboot.c

PATCH In review aq 1 participant 2 messages Aug 11, 2005

lore
Share & tools
lore

aq

author
#0 lore raw

PATCH 1/1 fix reboot.c

domU always reports an error "Ignoring shutdown request: -1" when we shutdown it from dom0 (using "xm shutdown" command). This patch fixes it.

# diffstat reboot2.patch 
 reboot.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +2 -1
diff -r d95ea17567c6 linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
@@ -254,7 +254,8 @@
     char *str;
 
     str = (char *)xenbus_read("control", "shutdown", NULL);
-    if (IS_ERR(str))
+    if (IS_ERR(str)||
+        !strcmp(str, "-1"))      /* ignore recursive shutdown event */
         return;
 
     xenbus_printf("control", "shutdown", "%i", SHUTDOWN_INVALID);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#1 lore raw
Quoted 4 lines · aq

domU always reports an error "Ignoring shutdown request: -1" when we shutdown it from dom0 (using "xm shutdown" command). This patch fixes it.

oops, please take this patch instead (it is better to use stringify to convert SHUTDOWN_INVALID to a string)

# diffstat reboot3.patch 
 reboot.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +3 -1
diff -r d95ea17567c6 linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
@@ -6,6 +6,7 @@
 #include <linux/module.h>
 #include <linux/reboot.h>
 #include <linux/sysrq.h>
+#include <linux/stringify.h>
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm-xen/evtchn.h>
@@ -254,7 +255,8 @@
     char *str;
 
     str = (char *)xenbus_read("control", "shutdown", NULL);
-    if (IS_ERR(str))
+    if (IS_ERR(str)||
+        !strcmp(str, __stringify(SHUTDOWN_INVALID)))      /* ignore recursive shutdown event */
         return;
 
     xenbus_printf("control", "shutdown", "%i", SHUTDOWN_INVALID);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel