direct-io.hg

changeset 15519:80099a459d7a

xend: Fix xm pause/unpause for inactive managed domains.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Tue Jul 10 10:15:01 2007 +0100 (2007-07-10)
parents 3f2d2adc87f7
children 73290f6fe70a
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Tue Jul 10 10:13:16 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Tue Jul 10 10:15:01 2007 +0100
     1.3 @@ -1112,6 +1112,10 @@ class XendDomain:
     1.4                  raise XendInvalidDomain(str(domid))
     1.5              if dominfo.getDomid() == DOM0_ID:
     1.6                  raise XendError("Cannot unpause privileged domain %s" % domid)
     1.7 +            if dominfo._stateGet() not in (DOM_STATE_PAUSED, DOM_STATE_RUNNING):
     1.8 +                raise VMBadState("Domain '%s' is not started" % domid,
     1.9 +                                 POWER_STATE_NAMES[DOM_STATE_PAUSED],
    1.10 +                                 POWER_STATE_NAMES[dominfo._stateGet()])
    1.11              log.info("Domain %s (%d) unpaused.", dominfo.getName(),
    1.12                       int(dominfo.getDomid()))
    1.13              dominfo.unpause()
    1.14 @@ -1137,6 +1141,10 @@ class XendDomain:
    1.15                  raise XendInvalidDomain(str(domid))
    1.16              if dominfo.getDomid() == DOM0_ID:
    1.17                  raise XendError("Cannot pause privileged domain %s" % domid)
    1.18 +            if dominfo._stateGet() not in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
    1.19 +                raise VMBadState("Domain '%s' is not started" % domid,
    1.20 +                                 POWER_STATE_NAMES[DOM_STATE_RUNNING],
    1.21 +                                 POWER_STATE_NAMES[dominfo._stateGet()])
    1.22              log.info("Domain %s (%d) paused.", dominfo.getName(),
    1.23                       int(dominfo.getDomid()))
    1.24              dominfo.pause()