Frank Pan
2011-Mar-30 13:51 UTC
[Xen-devel] [PATCH] [pvops] Report suspending error to xenbus
This patch works with "Protocol change of suspending through xenbus". Guest will post reason on "control/shutdown-error" when suspending is failed. Xend/libxl can make use of this information to avoid waste of time from timeout. If Xend/libxl has no such feature, the xenbus_write will failed and ignored. Signed-off-by: Frank Pan <frankpzh@gmail.com> --- linux-2.6-xen/drivers/xen/manage.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/linux-2.6-xen/drivers/xen/manage.c b/linux-2.6-xen/drivers/xen/manage.c index fa1d24c..3eec337 100644 --- a/linux-2.6-xen/drivers/xen/manage.c +++ b/linux-2.6-xen/drivers/xen/manage.c @@ -97,6 +97,7 @@ static void do_suspend(void) { int err; int cancelled = 1; + int failed = 1; shutting_down = SHUTDOWN_SUSPEND; @@ -144,6 +145,9 @@ static void do_suspend(void) printk(KERN_ERR "failed to start xen_suspend: %d\n", err); cancelled = 1; } + else { + failed = 0; + } out_resume: if (!cancelled) { @@ -166,6 +170,8 @@ out_destroy_sm: stop_machine_destroy(); out: + if (failed) + xenbus_write(XBT_NIL, "control", "shutdown-error", "failed"); shutting_down = SHUTDOWN_INVALID; } #endif /* CONFIG_PM_SLEEP */ @@ -213,6 +219,7 @@ static void shutdown_handler(struct xenbus_watch *watch, #endif } else { printk(KERN_INFO "Ignoring shutdown request: %s\n", str); + xenbus_write(XBT_NIL, "control", "shutdown-error", "unknown request"); shutting_down = SHUTDOWN_INVALID; } -- 1.7.0.4 -- 潘震皓, Frank Pan Computer Science and Technology Tsinghua University _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel