[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix xm save command for a inactive managed domain.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183970505 -3600
# Node ID 99143d572521c872f6d116a9f708b650bb2f8388
# Parent  107b9bde5e4d3487013441ec5ffb563d9a8b5414
Fix xm save command for a inactive managed domain.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomain.py |    6 +++++-
 tools/python/xen/xm/main.py         |    8 +-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff -r 107b9bde5e4d -r 99143d572521 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Mon Jul 09 09:39:51 2007 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Mon Jul 09 09:41:45 2007 +0100
@@ -1253,7 +1253,11 @@ class XendDomain:
                 raise XendInvalidDomain(str(domid))
 
             if dominfo.getDomid() == DOM0_ID:
-                raise XendError("Cannot save privileged domain %i" % domid)
+                raise XendError("Cannot save privileged domain %s" % 
str(domid))
+            if dominfo._stateGet() != DOM_STATE_RUNNING:
+                raise VMBadState("Domain is not running",
+                                 POWER_STATE_NAMES[DOM_STATE_RUNNING],
+                                 POWER_STATE_NAMES[dominfo._stateGet()])
 
             oflags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
             if hasattr(os, "O_LARGEFILE"):
diff -r 107b9bde5e4d -r 99143d572521 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Mon Jul 09 09:39:51 2007 +0100
+++ b/tools/python/xen/xm/main.py       Mon Jul 09 09:41:45 2007 +0100
@@ -700,13 +700,7 @@ def xm_save(args):
     if serverType == SERVER_XEN_API:       
         server.xenapi.VM.save(get_single_vm(dom), savefile, checkpoint)
     else:
-        try:
-            dominfo = parse_doms_info(server.xend.domain(dom))
-        except xmlrpclib.Fault, ex:
-            raise ex
-    
-        domid = dominfo['domid']
-        server.xend.domain.save(domid, savefile, checkpoint)
+        server.xend.domain.save(dom, savefile, checkpoint)
     
 def xm_restore(args):
     arg_check(args, "restore", 1, 2)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.