ia64/xen-unstable

changeset 7173:e6e5f22d19f8

Remove the reason parameter from XendDomain.destroy -- it is useless. Accept
the halt shutdown reason inside XendDomainInfo. This indicates that the
domain should be shutdown just like a poweroff, except that the domain is not
restarted, regardless of the on_poweroff configuration setting.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Oct 04 00:30:49 2005 +0100 (2005-10-04)
parents cc9988317416
children 600f3d2b78d6
files tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Tue Oct 04 00:21:49 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Tue Oct 04 00:30:49 2005 +0100
     1.3 @@ -316,16 +316,10 @@ class XendDomain:
     1.4              raise XendError(str(ex))
     1.5  
     1.6  
     1.7 -    def domain_shutdown(self, domid, reason='poweroff'):
     1.8 +    def domain_shutdown(self, domid, reason = 'poweroff'):
     1.9          """Shutdown domain (nicely).
    1.10 -         - poweroff: restart according to exit code and restart mode
    1.11 -         - reboot:   restart on exit
    1.12 -         - halt:     do not restart
    1.13  
    1.14 -         Returns immediately.
    1.15 -
    1.16 -        @param id:     domain id
    1.17 -        @param reason: shutdown type: poweroff, reboot, suspend, halt
    1.18 +        @param reason: shutdown reason: poweroff, reboot, suspend, halt
    1.19          """
    1.20          self.callInfo(domid, XendDomainInfo.shutdown, reason)
    1.21  
    1.22 @@ -335,13 +329,8 @@ class XendDomain:
    1.23          return self.callInfo(domid, XendDomainInfo.send_sysrq, key)
    1.24  
    1.25  
    1.26 -    def domain_destroy(self, domid, reason='halt'):
    1.27 -        """Terminate domain immediately.
    1.28 -        - halt:   cancel any restart for the domain
    1.29 -        - reboot  schedule a restart for the domain
    1.30 -
    1.31 -        @param domid: domain id
    1.32 -        """
    1.33 +    def domain_destroy(self, domid):
    1.34 +        """Terminate domain immediately."""
    1.35  
    1.36          if domid == PRIV_DOMAIN:
    1.37              raise XendError("Cannot destroy privileged domain %i" % domid)
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Oct 04 00:21:49 2005 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Oct 04 00:30:49 2005 +0100
     2.3 @@ -59,12 +59,16 @@ DOMAIN_SUSPEND  = 2
     2.4  """Shutdown code for crash."""
     2.5  DOMAIN_CRASH    = 3
     2.6  
     2.7 +"""Shutdown code for halt."""
     2.8 +DOMAIN_HALT     = 4
     2.9 +
    2.10  """Map shutdown codes to strings."""
    2.11  shutdown_reasons = {
    2.12      DOMAIN_POWEROFF: "poweroff",
    2.13      DOMAIN_REBOOT  : "reboot",
    2.14      DOMAIN_SUSPEND : "suspend",
    2.15      DOMAIN_CRASH   : "crash",
    2.16 +    DOMAIN_HALT    : "halt"
    2.17      }
    2.18  
    2.19  restart_modes = [