aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-12-05 15:54:22 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-12-05 15:54:22 +0000
commita046a6dc893165068ee4e6692b152da828dc1970 (patch)
treeadc7d4a1b15f94c20340c62cbb5bf81790a0cfca /tools
parent3d9c2d285656561eee54d9f0d44ee03f98e2cc46 (diff)
downloadxen-a046a6dc893165068ee4e6692b152da828dc1970.tar.gz
xen-a046a6dc893165068ee4e6692b152da828dc1970.tar.bz2
xen-a046a6dc893165068ee4e6692b152da828dc1970.zip
Fix domain save when guest is in S3.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py3
-rw-r--r--tools/xcutils/xc_save.c10
2 files changed, 4 insertions, 9 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index c91a577b2a..7a8349d035 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -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 --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c
index 9ece499f04..d11543e08d 100644
--- a/tools/xcutils/xc_save.c
+++ b/tools/xcutils/xc_save.c
@@ -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();