[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] [pvops] Report suspending error to xenbus


  • To: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
  • From: Frank Pan <frankpzh@xxxxxxxxx>
  • Date: Wed, 30 Mar 2011 21:51:14 +0800
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 30 Mar 2011 06:52:23 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; b=j9MhvOY9Vy+kxsC8ScXknHl8HCdgH33leML6gwHgUQ9p45VICS8mj5HXbLkaxEhC2m 7l/bMt+IPeWwFtKLAse2+XzZA+Cy0jhEC+2jFOh3CGA+rkMF2XmyjLf3bKmEz3c77bPO dLmAF8zXW8207tpDUjDlD+9aEcc9ljG1k/5pE=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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@xxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.