ia64/xen-unstable

changeset 18549:ddf62f696111

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 <kwolf@suse.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Sep 25 13:07:43 2008 +0100 (2008-09-25)
parents eececb5de4fa
children e1507b441be4
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Thu Sep 25 12:09:10 2008 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Thu Sep 25 13:07:43 2008 +0100
     1.3 @@ -1224,9 +1224,6 @@ def xm_start(args):
     1.4      if console_autoconnect:
     1.5          start_do_console(dom)
     1.6  
     1.7 -    if console_autoconnect:
     1.8 -        console.runVncViewer(domid, vncviewer_autopass, True)
     1.9 -
    1.10      try:
    1.11          if serverType == SERVER_XEN_API:
    1.12              server.xenapi.VM.start(get_single_vm(dom), paused)
    1.13 @@ -1241,6 +1238,10 @@ def xm_start(args):
    1.14      if domid == -1:
    1.15          raise xmlrpclib.Fault(0, "Domain '%s' is not started" % dom)
    1.16  
    1.17 +    if vncviewer:
    1.18 +        console.runVncViewer(domid, vncviewer_autopass, True)
    1.19 +
    1.20 +
    1.21  def xm_delete(args):
    1.22      arg_check(args, "delete", 1)
    1.23      dom = args[0]