ia64/xen-unstable

changeset 17680:7c8e2a2c006e

xm migrate: Better error report when attempt to migrate non-running domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 20 09:43:02 2008 +0100 (2008-05-20)
parents 13dda75739f2
children 2757cf34d1ea
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Tue May 20 09:41:52 2008 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Tue May 20 09:43:02 2008 +0100
     1.3 @@ -1282,6 +1282,10 @@ class XendDomain:
     1.4  
     1.5          if dominfo.getDomid() == DOM0_ID:
     1.6              raise XendError("Cannot migrate privileged domain %s" % domid)
     1.7 +        if dominfo._stateGet() != DOM_STATE_RUNNING:
     1.8 +            raise VMBadState("Domain is not running",
     1.9 +                             POWER_STATE_NAMES[DOM_STATE_RUNNING],
    1.10 +                             POWER_STATE_NAMES[dominfo._stateGet()])
    1.11  
    1.12          """ The following call may raise a XendError exception """
    1.13          dominfo.testMigrateDevices(True, dst)