fix xm create -load option issue
PATCH 1/1 fix xm create -load option issue
Hi,
When executed "xm create" with the load option (--load) , an error occurs.
error is :
Please report to [email protected]
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 1117, in main
rc = cmd(args)
File "<string>", line 1, in <lambda>
File "/usr/lib/python/xen/xm/main.py", line 553, in xm_subcommand
cmd.main([command] + args)
File "/usr/lib/python/xen/xm/create.py", line 891, in main
dom = make_domain(opts, config)
File "/usr/lib/python/xen/xm/create.py", line 824, in make_domain
dominfo = server.xend_domain_restore(filename, config)
TypeError: xend_domain_restore() takes exactly 2 arguments (3 given)
This patch fixed the problem above.
Best Regards,
Matsumoto
tools/python/xen/xm/create.py Fri Mar 17 16:35:42 2006 renamed from tools/python/xen/xm/create.py Wed Mar 15 19:25:50 2006 +7 -5
@@ -819,11 +819,7 @@ """ try: - if opts.vals.load: - filename = os.path.abspath(opts.vals.load) - dominfo = server.xend_domain_restore(filename, config) - else: - dominfo = server.xend_domain_create(config) + dominfo = server.xend_domain_create(config) except XendError, ex: import signal if vncpid:
@@ -852,6 +848,9 @@ gopts.load_defconfig(help=1) if gopts.vals.help or gopts.vals.help_config: return (None, None) + + if gopts.vals.load: + return (gopts, None) if not gopts.vals.display: gopts.vals.display = os.getenv("DISPLAY")
@@ -887,6 +886,9 @@ if opts.vals.dryrun: PrettyPrint.prettyprint(config) + elif opts.vals.load: + filename = os.path.abspath(opts.vals.load) + server.xend_domain_restore(filename) else: dom = make_domain(opts, config) if opts.vals.console_autoconnect:
Quoted 4 lines · Matsumoto
Hi,
When executed "xm create" with the load option (--load) , an error occurs.
I didn't even know that there _was_ an xm create --load command!
It seems to me that xm create --load is precisely equivalent to xm restore (following your patch). Obviously, no-one's using this -- it seems to have been broken since at least July 2004!
I'll just remove the option altogether -- please use xm restore instead.
Thanks,
Ewan.