fix reboot.c
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.
Signed-off-by Nguyen Anh Quynh <[email protected]>
# 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
@@ -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
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)
Signed-off-by Nguyen Anh Quynh <[email protected]>
# 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
@@ -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