ia64/xen-unstable

changeset 17806:37392df51f0b

xm on xenapi: Fixes for rfb console.
- set 'vncunused' param default to 1
- add 'vncdisplay' param
- handle the case when sdl=1

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jun 09 09:47:51 2008 +0100 (2008-06-09)
parents 6c5b9b355ce8
children a40c23c25b0d
files tools/python/xen/xend/XendConfig.py tools/python/xen/xm/xenapi_create.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Mon Jun 09 09:47:00 2008 +0100
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Mon Jun 09 09:47:51 2008 +0100
     1.3 @@ -1407,12 +1407,13 @@ class XendConfig(dict):
     1.4                      dev_uuid = uuid.createString()
     1.5                  dev_info['uuid'] = dev_uuid
     1.6                  dev_info['protocol'] = cfg_xenapi.get('protocol', 'rfb')
     1.7 -                dev_info['other_config'] = cfg_xenapi.get('other_config', {})
     1.8 +                console_other_config = cfg_xenapi.get('other_config', {})
     1.9 +                dev_info['other_config'] = console_other_config
    1.10                  if dev_info['protocol'] == 'rfb':
    1.11                      # collapse other config into devinfo for things
    1.12                      # such as vncpasswd, vncunused, etc.                    
    1.13 -                    dev_info.update(cfg_xenapi.get('other_config', {}))
    1.14 -                    dev_info['type'] = 'vnc'                        
    1.15 +                    dev_info.update(console_other_config)
    1.16 +                    dev_info['type'] = console_other_config.get('type', 'vnc') 
    1.17                      target['devices'][dev_uuid] = ('vfb', dev_info)
    1.18                      target['console_refs'].append(dev_uuid)
    1.19  
     2.1 --- a/tools/python/xen/xm/xenapi_create.py	Mon Jun 09 09:47:00 2008 +0100
     2.2 +++ b/tools/python/xen/xm/xenapi_create.py	Mon Jun 09 09:47:51 2008 +0100
     2.3 @@ -792,28 +792,36 @@ class sxp2xml:
     2.4              console = document.createElement("console")
     2.5              console.attributes["protocol"] = "rfb"
     2.6              console.appendChild(self.mk_other_config(
     2.7 -                "vncunused", str(get_child_by_name(image, "vncunused", "0")),
     2.8 +                "type", "vnc",
     2.9 +                document))
    2.10 +            console.appendChild(self.mk_other_config(
    2.11 +                "vncunused", str(get_child_by_name(image, "vncunused", "1")),
    2.12                  document))
    2.13              console.appendChild(self.mk_other_config(
    2.14                  "vnclisten",
    2.15                  get_child_by_name(image, "vnclisten", "127.0.0.1"),
    2.16                  document))
    2.17              console.appendChild(self.mk_other_config(
    2.18 +                "vncdisplay", str(get_child_by_name(image, "vncdisplay", "0")),
    2.19 +                document))
    2.20 +            console.appendChild(self.mk_other_config(
    2.21                  "vncpasswd", get_child_by_name(image, "vncpasswd", ""),
    2.22                  document))
    2.23              consoles.append(console)          
    2.24          if int(get_child_by_name(image, "sdl", "0")) == 1:
    2.25              console = document.createElement("console")
    2.26 -            console.attributes["protocol"] = "sdl"
    2.27 +            console.attributes["protocol"] = "rfb"
    2.28 +            console.appendChild(self.mk_other_config(
    2.29 +                "type", "sdl",
    2.30 +                document))
    2.31              console.appendChild(self.mk_other_config(
    2.32                  "display", get_child_by_name(image, "display", ""),
    2.33                  document))
    2.34              console.appendChild(self.mk_other_config(
    2.35 -                "xauthority",
    2.36 -                get_child_by_name(image, "vxauthority", "127.0.0.1"),
    2.37 +                "xauthority", get_child_by_name(image, "xauthority", ""),
    2.38                  document))
    2.39              console.appendChild(self.mk_other_config(
    2.40 -                "opengl", get_child_by_name(image, "opengl", "1"),
    2.41 +                "opengl", str(get_child_by_name(image, "opengl", "1")),
    2.42                  document))
    2.43              consoles.append(console)
    2.44