From: Keir Fraser Date: Thu, 25 Sep 2008 12:07:43 +0000 (+0100) Subject: xm: Fix xm start -c / --vncviewer X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14101^2~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0ae658ea9f3e26ec9ea613a1d5e85d8bf3296277;p=xen.git xm: Fix xm start -c / --vncviewer In xm start the --vncviewer option has no effect, instead -c tries to both connect to the console and start vncviewer. Additionally, to start vncviewer it uses the domid variable which is only defined a few lines later. Thus xm start -c doesn't work at all. This patch fixes both problems. Signed-off-by: Kevin Wolf --- diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index 968828e1b3..df8c7bfc3c 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -1224,9 +1224,6 @@ def xm_start(args): if console_autoconnect: start_do_console(dom) - if console_autoconnect: - console.runVncViewer(domid, vncviewer_autopass, True) - try: if serverType == SERVER_XEN_API: server.xenapi.VM.start(get_single_vm(dom), paused) @@ -1241,6 +1238,10 @@ def xm_start(args): if domid == -1: raise xmlrpclib.Fault(0, "Domain '%s' is not started" % dom) + if vncviewer: + console.runVncViewer(domid, vncviewer_autopass, True) + + def xm_delete(args): arg_check(args, "delete", 1) dom = args[0]