diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-06-10 13:50:31 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-06-10 13:50:31 +0100 |
commit | f4692e35f1d6f7b5ed623debf58d205f0749efd5 (patch) | |
tree | 9fe9f8c5beddfff32afe27197079c6a9c607f5c5 | |
parent | df8a7719e5f972641f6f6730e2bdc2ca5b584c37 (diff) | |
download | xen-f4692e35f1d6f7b5ed623debf58d205f0749efd5.tar.gz xen-f4692e35f1d6f7b5ed623debf58d205f0749efd5.tar.bz2 xen-f4692e35f1d6f7b5ed623debf58d205f0749efd5.zip |
xm on xenapi: Add PVFB support in xenapi_create.py.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
-rw-r--r-- | tools/python/xen/xm/xenapi_create.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py index 2c1d2d1457..df104bf72e 100644 --- a/tools/python/xen/xm/xenapi_create.py +++ b/tools/python/xen/xm/xenapi_create.py @@ -518,6 +518,9 @@ class sxp2xml: vtpms_sxp = map(lambda x: x[1], [device for device in devices if device[1][0] == "vtpm"]) + vfbs_sxp = map(lambda x: x[1], [device for device in devices + if device[1][0] == "vfb"]) + # Create XML Document impl = getDOMImplementation() @@ -657,6 +660,10 @@ class sxp2xml: map(vm.appendChild, consoles) + vfbs = map(lambda vfb: self.extract_vfb(vfb, document), vfbs_sxp) + + map(vm.appendChild, vfbs) + # Platform variables... platform = self.extract_platform(image, document) @@ -774,6 +781,46 @@ class sxp2xml: return vtpm + def extract_vfb(self, vfb_sxp, document): + + vfb = document.createElement("console") + vfb.attributes["protocol"] = "rfb" + + if get_child_by_name(vfb_sxp, "type", "") == "vnc": + vfb.appendChild(self.mk_other_config( + "type", "vnc", + document)) + vfb.appendChild(self.mk_other_config( + "vncunused", get_child_by_name(vfb_sxp, "vncunused", "1"), + document)) + vfb.appendChild(self.mk_other_config( + "vnclisten", + get_child_by_name(vfb_sxp, "vnclisten", "127.0.0.1"), + document)) + vfb.appendChild(self.mk_other_config( + "vncdisplay", get_child_by_name(vfb_sxp, "vncdisplay", "0"), + document)) + vfb.appendChild(self.mk_other_config( + "vncpasswd", get_child_by_name(vfb_sxp, "vncpasswd", ""), + document)) + + if get_child_by_name(vfb_sxp, "type", "") == "sdl": + vfb.appendChild(self.mk_other_config( + "type", "sdl", + document)) + vfb.appendChild(self.mk_other_config( + "display", get_child_by_name(vfb_sxp, "display", ""), + document)) + vfb.appendChild(self.mk_other_config( + "xauthority", + get_child_by_name(vfb_sxp, "xauthority", ""), + document)) + vfb.appendChild(self.mk_other_config( + "opengl", get_child_by_name(vfb_sxp, "opengl", "1"), + document)) + + return vfb + _eths = -1 def mk_other_config(self, key, value, document): |