aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-06-09 09:47:51 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-06-09 09:47:51 +0100
commitfd153d12f2ad8b6fad5edf05b488531c95de760b (patch)
treec1fd9110770f98dd5ced947782aac3bc99ce4fb1
parent1ece20c929a771dfcc3985ab4e68b33616eebf9c (diff)
downloadxen-fd153d12f2ad8b6fad5edf05b488531c95de760b.tar.gz
xen-fd153d12f2ad8b6fad5edf05b488531c95de760b.tar.bz2
xen-fd153d12f2ad8b6fad5edf05b488531c95de760b.zip
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>
-rw-r--r--tools/python/xen/xend/XendConfig.py7
-rw-r--r--tools/python/xen/xm/xenapi_create.py18
2 files changed, 17 insertions, 8 deletions
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 8c76a11085..2aae44ef5e 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -1407,12 +1407,13 @@ class XendConfig(dict):
dev_uuid = uuid.createString()
dev_info['uuid'] = dev_uuid
dev_info['protocol'] = cfg_xenapi.get('protocol', 'rfb')
- dev_info['other_config'] = cfg_xenapi.get('other_config', {})
+ console_other_config = cfg_xenapi.get('other_config', {})
+ dev_info['other_config'] = console_other_config
if dev_info['protocol'] == 'rfb':
# collapse other config into devinfo for things
# such as vncpasswd, vncunused, etc.
- dev_info.update(cfg_xenapi.get('other_config', {}))
- dev_info['type'] = 'vnc'
+ dev_info.update(console_other_config)
+ dev_info['type'] = console_other_config.get('type', 'vnc')
target['devices'][dev_uuid] = ('vfb', dev_info)
target['console_refs'].append(dev_uuid)
diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py
index 1a341620b6..2c1d2d1457 100644
--- a/tools/python/xen/xm/xenapi_create.py
+++ b/tools/python/xen/xm/xenapi_create.py
@@ -792,28 +792,36 @@ class sxp2xml:
console = document.createElement("console")
console.attributes["protocol"] = "rfb"
console.appendChild(self.mk_other_config(
- "vncunused", str(get_child_by_name(image, "vncunused", "0")),
+ "type", "vnc",
+ document))
+ console.appendChild(self.mk_other_config(
+ "vncunused", str(get_child_by_name(image, "vncunused", "1")),
document))
console.appendChild(self.mk_other_config(
"vnclisten",
get_child_by_name(image, "vnclisten", "127.0.0.1"),
document))
console.appendChild(self.mk_other_config(
+ "vncdisplay", str(get_child_by_name(image, "vncdisplay", "0")),
+ document))
+ console.appendChild(self.mk_other_config(
"vncpasswd", get_child_by_name(image, "vncpasswd", ""),
document))
consoles.append(console)
if int(get_child_by_name(image, "sdl", "0")) == 1:
console = document.createElement("console")
- console.attributes["protocol"] = "sdl"
+ console.attributes["protocol"] = "rfb"
+ console.appendChild(self.mk_other_config(
+ "type", "sdl",
+ document))
console.appendChild(self.mk_other_config(
"display", get_child_by_name(image, "display", ""),
document))
console.appendChild(self.mk_other_config(
- "xauthority",
- get_child_by_name(image, "vxauthority", "127.0.0.1"),
+ "xauthority", get_child_by_name(image, "xauthority", ""),
document))
console.appendChild(self.mk_other_config(
- "opengl", get_child_by_name(image, "opengl", "1"),
+ "opengl", str(get_child_by_name(image, "opengl", "1")),
document))
consoles.append(console)