ia64/xen-unstable

changeset 1638:5810a8961c25

bitkeeper revision 1.1041 (40e2b500MGNaabM3zohLHzL0u1Ui7Q)

Fix console_autoconnect option in 'xm create'.
author kaf24@scramble.cl.cam.ac.uk
date Wed Jun 30 12:41:36 2004 +0000 (2004-06-30)
parents ebcc736aed4f
children 5c960c07a441 c58d41206122
files tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/python/xen/xm/create.py	Wed Jun 30 11:50:31 2004 +0000
     1.2 +++ b/tools/python/xen/xm/create.py	Wed Jun 30 12:41:36 2004 +0000
     1.3 @@ -8,6 +8,8 @@ from xen.xend import sxp
     1.4  from xen.xend import PrettyPrint
     1.5  from xen.xend.XendClient import server
     1.6  
     1.7 +from xen.util import console_client
     1.8 +
     1.9  from xen.xm.opts import *
    1.10  
    1.11  gopts = Opts(use="""[options]
    1.12 @@ -52,7 +54,7 @@ gopts.opt('name', short='N', val='NAME',
    1.13            fn=set_value, default=None,
    1.14            use="Domain name.")
    1.15  
    1.16 -gopts.opt('console', short='c',
    1.17 +gopts.opt('console_autoconnect', short='c',
    1.18           fn=set_true, default=0,
    1.19           use="Connect to console after domain is created.")
    1.20  
    1.21 @@ -82,8 +84,8 @@ gopts.opt('netif',
    1.22  
    1.23  gopts.opt('disk', short='d', val='phy:DEV,VDEV,MODE',
    1.24           fn=append_value, default=[],
    1.25 -         use="""Add a disk device to a domain. The physical device is DEV, which
    1.26 -         is exported to the domain as VDEV. The disk is read-only if MODE
    1.27 +         use="""Add a disk device to a domain. The physical device is DEV,
    1.28 +         which is exported to the domain as VDEV. The disk is read-only if MODE
    1.29           is 'r', read-write if MODE is 'w'.
    1.30           The option may be repeated to add more than one disk.
    1.31           """)
    1.32 @@ -360,7 +362,9 @@ def main(argv):
    1.33      if opts.vals.dryrun:
    1.34          PrettyPrint.prettyprint(config)
    1.35      else:
    1.36 -        make_domain(opts, config)
    1.37 +        (d, c) = make_domain(opts, config)
    1.38 +        if opts.vals.console_autoconnect:
    1.39 +            console_client.connect('localhost', c)
    1.40          
    1.41  if __name__ == '__main__':
    1.42      main(sys.argv)