ia64/xen-unstable

changeset 17686:672c09aad49d

xend: Support HVM S3 resume.
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Ke Liping <liping.ke@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 20 14:50:45 2008 +0100 (2008-05-20)
parents 7c752689b0ea
children d795e15b85a7
files tools/python/xen/xend/XendConstants.py tools/python/xen/xend/XendDomain.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConstants.py	Tue May 20 14:36:05 2008 +0100
     1.2 +++ b/tools/python/xen/xend/XendConstants.py	Tue May 20 14:50:45 2008 +0100
     1.3 @@ -48,6 +48,7 @@ HVM_PARAM_VHPT_SIZE    = 8
     1.4  HVM_PARAM_BUFPIOREQ_PFN = 9
     1.5  HVM_PARAM_TIMER_MODE   = 10
     1.6  HVM_PARAM_HPET_ENABLED = 11
     1.7 +HVM_PARAM_ACPI_S_STATE = 14
     1.8  
     1.9  restart_modes = [
    1.10      "restart",
    1.11 @@ -102,11 +103,13 @@ LAST_SHUTDOWN_REASON = 'xend/last_shutdo
    1.12  TRIGGER_NMI   = 0
    1.13  TRIGGER_RESET = 1
    1.14  TRIGGER_INIT  = 2
    1.15 +TRIGGER_S3RESUME = 3
    1.16  
    1.17  TRIGGER_TYPE = {
    1.18      "nmi"   : TRIGGER_NMI,
    1.19      "reset" : TRIGGER_RESET,
    1.20 -    "init"  : TRIGGER_INIT
    1.21 +    "init"  : TRIGGER_INIT,
    1.22 +    "s3resume": TRIGGER_S3RESUME
    1.23  }
    1.24  
    1.25  #
     2.1 --- a/tools/python/xen/xend/XendDomain.py	Tue May 20 14:36:05 2008 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomain.py	Tue May 20 14:50:45 2008 +0100
     2.3 @@ -1657,6 +1657,9 @@ class XendDomain:
     2.4              trigger = TRIGGER_TYPE[trigger_name.lower()]
     2.5          else:
     2.6              raise XendError("Invalid trigger: %s" % trigger_name)
     2.7 +        if trigger == TRIGGER_S3RESUME:
     2.8 +            xc.hvm_set_param(dominfo.getDomid(), HVM_PARAM_ACPI_S_STATE, 0)
     2.9 +            return None
    2.10          try:
    2.11              return xc.domain_send_trigger(dominfo.getDomid(),
    2.12                                            trigger,
     3.1 --- a/tools/python/xen/xm/main.py	Tue May 20 14:36:05 2008 +0100
     3.2 +++ b/tools/python/xen/xm/main.py	Tue May 20 14:50:45 2008 +0100
     3.3 @@ -143,7 +143,7 @@ SUBCOMMAND_HELP = {
     3.4                       'Get/set credit scheduler parameters.'),
     3.5      'sysrq'       : ('<Domain> <letter>', 'Send a sysrq to a domain.'),
     3.6      'debug-keys'  : ('<Keys>', 'Send debug keys to Xen.'),
     3.7 -    'trigger'     : ('<Domain> <nmi|reset|init> [<VCPU>]',
     3.8 +    'trigger'     : ('<Domain> <nmi|reset|init|s3resume> [<VCPU>]',
     3.9                       'Send a trigger to a domain.'),
    3.10      'vcpu-list'   : ('[Domain, ...]',
    3.11                       'List the VCPUs for all/some domains.'),