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

[Xen-devel] [PATCH] Fix xm save command

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix xm save command
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: Wed, 27 Feb 2008 18:26:58 +0900
Delivery-date: Wed, 27 Feb 2008 01:27:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

When I didn't give a necessary argument to xm save command, I saw 
the following error message. 

# xm save -c vm1
Unexpected error: exceptions.IndexError

Please report to xen-devel@xxxxxxxxxxxxxxxxxxx
Traceback (most recent call last):
  File "/usr/sbin/xm", line 10, in ?
    main.main(sys.argv)
  File "/usr/lib/python/xen/xm/main.py", line 2594, in main
    _, rc = _run_cmd(cmd, cmd_name, args)
  File "/usr/lib/python/xen/xm/main.py", line 2618, in _run_cmd
    return True, cmd(args)
  File "/usr/lib/python/xen/xm/main.py", line 703, in xm_save
    savefile = params[1]
IndexError: list index out of range


This patch fixes the problem.  A test result is as follows. 

# xm save -c vm1
Error: Wrong number of parameters
Usage: xm save [-c] <Domain> <CheckpointFile>

Save a domain state to restore later.
  -c, --checkpoint               Leave domain running after creating
                                 snapshot


And the following sys.exit(1) is not necessary because sys.exit(1) 
is executed in usage(). 

@@ -710,9 +707,9 @@ def xm_save(args):
     if len(params) != 2:
         err("Wrong number of parameters")
         usage('save')
-        sys.exit(1)


Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>

Best regards,
 Kan

Attachment: xm_save.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix xm save command, Masaki Kanno <=