WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] Fix xm save command for a inactive manageddomain
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: Mon, 09 Jul 2007 17:37:50 +0900
Delivery-date: Mon, 09 Jul 2007 01:36:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <48C7BF0305BC22kanno.masaki@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <48C7BF0305BC22kanno.masaki@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>