ia64/xen-unstable

changeset 19751:eeb0fce9aeaf

xend: support multiple consoles per domain

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 16 11:25:37 2009 +0100 (2009-06-16)
parents f07a915ecc17
children fa51db0871e1
files stubdom/stubdom-dm tools/python/xen/xend/XendConfig.py tools/python/xen/xend/image.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/stubdom/stubdom-dm	Tue Jun 16 11:24:58 2009 +0100
     1.2 +++ b/stubdom/stubdom-dm	Tue Jun 16 11:25:37 2009 +0100
     1.3 @@ -52,6 +52,10 @@ do
     1.4                  keymap=$2
     1.5                  shift
     1.6                  ;;
     1.7 +	    -serial)
     1.8 +		serial="$2"
     1.9 +		shift
    1.10 +		;;
    1.11  	esac
    1.12      fi
    1.13      case "$1" in
    1.14 @@ -100,6 +104,7 @@ test $vnc != 0 && vfb="$vfb, vnc=$vnc, v
    1.15  vncpasswd=`xenstore-read /local/domain/0/backend/vfb/$domid/0/vncpasswd 2>/dev/null`
    1.16  test "$vncpasswd" && vfb="$vfb, vncpasswd=$vncpasswd"
    1.17  test "$keymap" && vfb="$vfb, keymap=$keymap"
    1.18 +test "$serial" && vfb="$vfb, serial=$serial"
    1.19  echo "vfb = ['$vfb']" >> /etc/xen/stubdoms/$domname-dm
    1.20  
    1.21  echo -n "disk = [ " >> /etc/xen/stubdoms/$domname-dm
     2.1 --- a/tools/python/xen/xend/XendConfig.py	Tue Jun 16 11:24:58 2009 +0100
     2.2 +++ b/tools/python/xen/xend/XendConfig.py	Tue Jun 16 11:25:37 2009 +0100
     2.3 @@ -1432,6 +1432,16 @@ class XendConfig(dict):
     2.4  		    del dev_info['type']
     2.5  		    log.debug("iwj dev_type=%s vfb setting dev_info['%s']" %
     2.6  				(dev_type, vfb_type))
     2.7 +                if dev_info.get('serial') is not None :
     2.8 +                    # Create two serial backends now, the location value is bogus, but does not matter
     2.9 +                    cfg = self.console_add('vt100', '0')
    2.10 +                    c_uuid = uuid.createString()
    2.11 +                    target['devices'][c_uuid] = ('console', cfg)
    2.12 +                    target['console_refs'].append(c_uuid)
    2.13 +                    cfg = self.console_add('vt100', '1')
    2.14 +                    c_uuid = uuid.createString()
    2.15 +                    target['devices'][c_uuid] = ('console', cfg)
    2.16 +                    target['console_refs'].append(c_uuid)
    2.17                  
    2.18              elif dev_type == 'console':
    2.19                  if 'console_refs' not in target:
     3.1 --- a/tools/python/xen/xend/image.py	Tue Jun 16 11:24:58 2009 +0100
     3.2 +++ b/tools/python/xen/xend/image.py	Tue Jun 16 11:25:37 2009 +0100
     3.3 @@ -286,6 +286,9 @@ class ImageHandler:
     3.4              if dev_type == 'vfb':
     3.5                  if 'keymap' in dev_info:
     3.6                      keymap = dev_info.get('keymap',{})
     3.7 +                if 'serial' in dev_info:
     3.8 +                    ret.append("-serial")
     3.9 +                    ret.append(dev_info.get('serial',{}))
    3.10                  if int(dev_info.get('vnc', 0)) != 0 :
    3.11                      has_vnc = True
    3.12                  if int(dev_info.get('sdl', 0)) != 0 :
    3.13 @@ -746,12 +749,10 @@ class HVMImageHandler(ImageHandler):
    3.14  
    3.15          if not self.display :
    3.16              self.display = ''
    3.17 -        # Do not store sdl, opengl and serial related qemu cli options
    3.18 +        # Do not store sdl and opengl qemu cli options
    3.19          self.vm.storeVm(("image/dmargs", " ".join([ x for x in self.dmargs
    3.20                          if x != "-sdl"
    3.21 -                        and x != "-disable-opengl"
    3.22 -                        and x != "-serial"
    3.23 -                        and x != "pty" ])),
    3.24 +                        and x != "-disable-opengl" ])),
    3.25                          ("image/device-model", self.device_model),
    3.26                          ("image/display", self.display))
    3.27          self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )
     4.1 --- a/tools/python/xen/xm/create.py	Tue Jun 16 11:24:58 2009 +0100
     4.2 +++ b/tools/python/xen/xm/create.py	Tue Jun 16 11:25:37 2009 +0100
     4.3 @@ -352,7 +352,7 @@ gopts.var('irq', val='IRQ',
     4.4           For example 'irq=7'.
     4.5           This option may be repeated to add more than one IRQ.""")
     4.6  
     4.7 -gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE",
     4.8 +gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE,serial=FILE",
     4.9            fn=append_value, default=[],
    4.10            use="""Make the domain a framebuffer backend.
    4.11            Both sdl=1 and vnc=1 can be enabled at the same time.
    4.12 @@ -364,7 +364,8 @@ gopts.var('vfb', val="vnc=1,sdl=1,vncunu
    4.13            For sdl=1, a viewer will be started automatically using the
    4.14            given DISPLAY and XAUTHORITY, which default to the current user's
    4.15            ones.  OpenGL will be used by default unless opengl is set to 0.
    4.16 -          keymap overrides the XendD configured default layout file.""")
    4.17 +          keymap overrides the XendD configured default layout file.
    4.18 +	  Serial adds a second serial support to qemu.""")
    4.19  
    4.20  gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \
    4.21            "backend=DOM,vifname=NAME,rate=RATE,model=MODEL,accel=ACCEL",
    4.22 @@ -827,7 +828,7 @@ def configure_vfbs(config_devs, vals):
    4.23          for (k,v) in d.iteritems():
    4.24              if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display',
    4.25                            'videoram', 'xauthority', 'sdl', 'vnc', 'vncpasswd',
    4.26 -                          'opengl', 'keymap' ]:
    4.27 +                          'opengl', 'keymap', 'serial' ]:
    4.28                  err("configuration option %s unknown to vfbs" % k)
    4.29              config.append([k,v])
    4.30          if not d.has_key("keymap"):