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

[Xen-changelog] [xen-unstable] Fix domain save when guest is in S3.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1228492462 0
# Node ID cc82d54bedfd20442a1604907ed65c5166397c43
# Parent  d206692cbcbe33305afc4879a4b3ece44a8aba93
Fix domain save when guest is in S3.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    3 ++-
 tools/xcutils/xc_save.c                 |   12 +++---------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff -r d206692cbcbe -r cc82d54bedfd tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Dec 05 15:24:12 2008 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Dec 05 15:54:22 2008 +0000
@@ -517,7 +517,8 @@ class XendDomainInfo:
         # HVM domain shuts itself down only if it has PV drivers
         if self.info.is_hvm():
             hvm_pvdrv = xc.hvm_get_param(self.domid, HVM_PARAM_CALLBACK_IRQ)
-            if not hvm_pvdrv:
+            hvm_s_state = xc.hvm_get_param(self.domid, HVM_PARAM_ACPI_S_STATE)
+            if not hvm_pvdrv or hvm_s_state != 0:
                 code = REVERSE_DOMAIN_SHUTDOWN_REASONS[reason]
                 log.info("HVM save:remote shutdown dom %d!", self.domid)
                 xc.domain_shutdown(self.domid, code)
diff -r d206692cbcbe -r cc82d54bedfd tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c   Fri Dec 05 15:24:12 2008 +0000
+++ b/tools/xcutils/xc_save.c   Fri Dec 05 15:54:22 2008 +0000
@@ -166,18 +166,12 @@ static int suspend(void)
 {
     unsigned long sx_state = 0;
 
-    /* Nothing to do if the guest is in an ACPI sleep state. */
+    /* Cannot notify guest to shut itself down if it's in ACPI sleep state. */
     if (si.flags & XCFLAGS_HVM)
         xc_get_hvm_param(si.xc_fd, si.domid,
                          HVM_PARAM_ACPI_S_STATE, &sx_state);
-    if (sx_state != 0) {
-        /* notify xend that it can do device migration */
-        printf("suspended\n");
-        fflush(stdout);
-        return 1;
-    }
-
-    if (si.suspend_evtchn >= 0)
+
+    if ((sx_state == 0) && (si.suspend_evtchn >= 0))
         return evtchn_suspend();
 
     return compat_suspend();

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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