aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-11 22:18:02 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-11 22:18:02 +0000
commit42996316f55b1ba88facded4b9d46278720b8e11 (patch)
treee267229a418a5d944a0b7ff31200e38719e93378
parent3184c77cda6a4abec7c859ac9fabf0080bbd9eb4 (diff)
downloadxen-42996316f55b1ba88facded4b9d46278720b8e11.tar.gz
xen-42996316f55b1ba88facded4b9d46278720b8e11.tar.bz2
xen-42996316f55b1ba88facded4b9d46278720b8e11.zip
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 <aquynh@gmail.com>
-rw-r--r--linux-2.6-xen-sparse/arch/xen/kernel/reboot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
index 683ddba5ed..585c94e282 100644
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
+++ b/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 @@ static void shutdown_handler(struct xenbus_watch *watch, const char *node)
char *str;
str = (char *)xenbus_read("control", "shutdown", NULL);
- if (IS_ERR(str))
+ /* Ignore read errors and recursive shutdown events. */
+ if (IS_ERR(str) || !strcmp(str, __stringify(SHUTDOWN_INVALID)))
return;
xenbus_printf("control", "shutdown", "%i", SHUTDOWN_INVALID);