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

Re: [Xen-devel] [PATCH] Fix xm save command for a inactive manageddomain



Hi,

Could you comment this patch?
To solve the problems, should I use XendError(), not VMBadState()?

diff -r e7d40fadbf17 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Jul 04 10:34:18 2007 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Thu Jul 05 17:23:24 2007 +0900
@@ -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"):

Best regards,
 Kan

>Hi,
>
>I tried to test wrong operations on purpose.
>
>1. When I tried xm save command to a inactive managed domain, 
>   I saw the following error message. The error message did not 
>   have a domain name. 
>
> # xm list vm1
> Name                                        ID   Mem VCPUs      State   
>Time(s)
> vm1                                              512     2                
> 0.0
> # xm save vm1 /xen/save.vm1
> Error: Domain '' does not exist.
>
>2. When I tried xm save command to Domain-0, I saw the following 
>   error message. 
>
> # xm save Domain-0 /xen/save.Domain-0
> Error: int argument required
> Usage: xm save [-c] <Domain> <CheckpointFile>
> 
> Save a domain state to restore later.
>   -c, --checkpoint               Leave domain running after creating
>                                  snapshot
>
>I made a patch.  It solved the problems. 
>
>Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
>
>Best regards,
> Kan
>
>
>-------------------------------text/plain-------------------------------
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-devel


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


 


Rackspace

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