direct-io.hg

changeset 15502:99143d572521

Fix xm save command for a inactive managed domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Mon Jul 09 09:41:45 2007 +0100 (2007-07-09)
parents 107b9bde5e4d
children 27e993c80ceb
files tools/python/xen/xend/XendDomain.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Mon Jul 09 09:39:51 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Mon Jul 09 09:41:45 2007 +0100
     1.3 @@ -1253,7 +1253,11 @@ class XendDomain:
     1.4                  raise XendInvalidDomain(str(domid))
     1.5  
     1.6              if dominfo.getDomid() == DOM0_ID:
     1.7 -                raise XendError("Cannot save privileged domain %i" % domid)
     1.8 +                raise XendError("Cannot save privileged domain %s" % str(domid))
     1.9 +            if dominfo._stateGet() != DOM_STATE_RUNNING:
    1.10 +                raise VMBadState("Domain is not running",
    1.11 +                                 POWER_STATE_NAMES[DOM_STATE_RUNNING],
    1.12 +                                 POWER_STATE_NAMES[dominfo._stateGet()])
    1.13  
    1.14              oflags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
    1.15              if hasattr(os, "O_LARGEFILE"):
     2.1 --- a/tools/python/xen/xm/main.py	Mon Jul 09 09:39:51 2007 +0100
     2.2 +++ b/tools/python/xen/xm/main.py	Mon Jul 09 09:41:45 2007 +0100
     2.3 @@ -700,13 +700,7 @@ def xm_save(args):
     2.4      if serverType == SERVER_XEN_API:       
     2.5          server.xenapi.VM.save(get_single_vm(dom), savefile, checkpoint)
     2.6      else:
     2.7 -        try:
     2.8 -            dominfo = parse_doms_info(server.xend.domain(dom))
     2.9 -        except xmlrpclib.Fault, ex:
    2.10 -            raise ex
    2.11 -    
    2.12 -        domid = dominfo['domid']
    2.13 -        server.xend.domain.save(domid, savefile, checkpoint)
    2.14 +        server.xend.domain.save(dom, savefile, checkpoint)
    2.15      
    2.16  def xm_restore(args):
    2.17      arg_check(args, "restore", 1, 2)