ia64/xen-unstable

changeset 18891:cc82d54bedfd

Fix domain save when guest is in S3.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Dec 05 15:54:22 2008 +0000 (2008-12-05)
parents d206692cbcbe
children 76099ad24cbd
files tools/python/xen/xend/XendDomainInfo.py tools/xcutils/xc_save.c
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Dec 05 15:24:12 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Dec 05 15:54:22 2008 +0000
     1.3 @@ -517,7 +517,8 @@ class XendDomainInfo:
     1.4          # HVM domain shuts itself down only if it has PV drivers
     1.5          if self.info.is_hvm():
     1.6              hvm_pvdrv = xc.hvm_get_param(self.domid, HVM_PARAM_CALLBACK_IRQ)
     1.7 -            if not hvm_pvdrv:
     1.8 +            hvm_s_state = xc.hvm_get_param(self.domid, HVM_PARAM_ACPI_S_STATE)
     1.9 +            if not hvm_pvdrv or hvm_s_state != 0:
    1.10                  code = REVERSE_DOMAIN_SHUTDOWN_REASONS[reason]
    1.11                  log.info("HVM save:remote shutdown dom %d!", self.domid)
    1.12                  xc.domain_shutdown(self.domid, code)
     2.1 --- a/tools/xcutils/xc_save.c	Fri Dec 05 15:24:12 2008 +0000
     2.2 +++ b/tools/xcutils/xc_save.c	Fri Dec 05 15:54:22 2008 +0000
     2.3 @@ -166,18 +166,12 @@ static int suspend(void)
     2.4  {
     2.5      unsigned long sx_state = 0;
     2.6  
     2.7 -    /* Nothing to do if the guest is in an ACPI sleep state. */
     2.8 +    /* Cannot notify guest to shut itself down if it's in ACPI sleep state. */
     2.9      if (si.flags & XCFLAGS_HVM)
    2.10          xc_get_hvm_param(si.xc_fd, si.domid,
    2.11                           HVM_PARAM_ACPI_S_STATE, &sx_state);
    2.12 -    if (sx_state != 0) {
    2.13 -        /* notify xend that it can do device migration */
    2.14 -        printf("suspended\n");
    2.15 -        fflush(stdout);
    2.16 -        return 1;
    2.17 -    }
    2.18  
    2.19 -    if (si.suspend_evtchn >= 0)
    2.20 +    if ((sx_state == 0) && (si.suspend_evtchn >= 0))
    2.21          return evtchn_suspend();
    2.22  
    2.23      return compat_suspend();