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

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



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

 


Rackspace

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