aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-03-06 19:13:23 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-03-06 19:13:23 +0000
commit3ba7d233c7cf9bcd152314be5992ea3ddf2bc37a (patch)
treec613d9da58a6e46d59122d5bd50f735dedd3c556 /tools
parent31e93ebbdd541a9b9bbb08089b663c1201a069d9 (diff)
downloadxen-3ba7d233c7cf9bcd152314be5992ea3ddf2bc37a.tar.gz
xen-3ba7d233c7cf9bcd152314be5992ea3ddf2bc37a.tar.bz2
xen-3ba7d233c7cf9bcd152314be5992ea3ddf2bc37a.zip
xend: allow VM configuration with both sdl=1 and vnc=1
In the stubdom case you can now specify sdl=1 and vnc=1 (again, both can be selected at the same time) in the vfb configuration. So instead of: vfb = [ 'type=vnc' ] now you have: vfb = [ 'vnc=1,sdl=1' ] the former configuration option is deprecated but still supported for backward compatibility. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/examples/xmexample.hvm-dm2
-rw-r--r--tools/examples/xmexample.pv-grub12
-rw-r--r--tools/examples/xmexample112
-rw-r--r--tools/examples/xmexample212
-rw-r--r--tools/examples/xmexample312
-rw-r--r--tools/python/xen/xend/XendConfig.py7
-rw-r--r--tools/python/xen/xend/image.py20
-rw-r--r--tools/python/xen/xm/create.py16
8 files changed, 50 insertions, 43 deletions
diff --git a/tools/examples/xmexample.hvm-dm b/tools/examples/xmexample.hvm-dm
index de1619ba32..9e7d207b98 100644
--- a/tools/examples/xmexample.hvm-dm
+++ b/tools/examples/xmexample.hvm-dm
@@ -11,4 +11,4 @@ vif = [ '', 'type=ioemu, bridge=xenbr0' ]
disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
# Actual output via PVFB
-vfb = [ 'type=sdl' ]
+vfb = [ 'sdl=1' ]
diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
index 2d647c9365..1b687151b6 100644
--- a/tools/examples/xmexample.pv-grub
+++ b/tools/examples/xmexample.pv-grub
@@ -77,29 +77,29 @@ disk = [ 'phy:hda1,hda1,w' ]
#
# To create one using the SDL backend and sensible defaults:
#
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
#
# This uses environment variables XAUTHORITY and DISPLAY. You
# can override that:
#
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
#
# To create one using the VNC backend and sensible defaults:
#
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
#
# The backend listens on 127.0.0.1 port 5900+N by default, where N is
# the domain ID. You can override both address and N:
#
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=1' ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=1' ]
#
# Or you can bind the first unused port above 5900:
#
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
#
# You can override the password:
#
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
#
# Empty password disables authentication. Defaults to the vncpasswd
# configured in xend-config.sxp.
diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
index fe382d43f6..330aaf0999 100644
--- a/tools/examples/xmexample1
+++ b/tools/examples/xmexample1
@@ -73,29 +73,29 @@ disk = [ 'phy:hda1,hda1,w' ]
#
# To create one using the SDL backend and sensible defaults:
#
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
#
# This uses environment variables XAUTHORITY and DISPLAY. You
# can override that:
#
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
#
# To create one using the VNC backend and sensible defaults:
#
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
#
# The backend listens on 127.0.0.1 port 5900+N by default, where N is
# the domain ID. You can override both address and N:
#
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=1' ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=1' ]
#
# Or you can bind the first unused port above 5900:
#
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
#
# You can override the password:
#
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
#
# Empty password disables authentication. Defaults to the vncpasswd
# configured in xend-config.sxp.
diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
index 53ee3aa98e..4e5eb3dffb 100644
--- a/tools/examples/xmexample2
+++ b/tools/examples/xmexample2
@@ -109,29 +109,29 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
#
# To create one using the SDL backend and sensible defaults:
#
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
#
# This uses environment variables XAUTHORITY and DISPLAY. You
# can override that:
#
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
#
# To create one using the VNC backend and sensible defaults:
#
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
#
# The backend listens on 127.0.0.1 port 5900+N by default, where N is
# the domain ID. You can override both address and N:
#
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
#
# Or you can bind the first unused port above 5900:
#
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
#
# You can override the password:
#
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
#
# Empty password disables authentication. Defaults to the vncpasswd
# configured in xend-config.sxp.
diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
index 99281904fd..dc22ce1db3 100644
--- a/tools/examples/xmexample3
+++ b/tools/examples/xmexample3
@@ -94,29 +94,29 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
#
# To create one using the SDL backend and sensible defaults:
#
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
#
# This uses environment variables XAUTHORITY and DISPLAY. You
# can override that:
#
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
#
# To create one using the VNC backend and sensible defaults:
#
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
#
# The backend listens on 127.0.0.1 port 5900+N by default, where N is
# the domain ID. You can override both address and N:
#
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
#
# Or you can bind the first unused port above 5900:
#
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
#
# You can override the password:
#
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
#
# Empty password disables authentication. Defaults to the vncpasswd
# configured in xend-config.sxp.
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index bb0a0bc26d..e147133649 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -174,7 +174,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
# Xen API console 'other_config' keys.
XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
- 'vncpasswd', 'type', 'display', 'xauthority',
+ 'vncpasswd', 'sdl', 'vnc', 'display', 'xauthority',
'keymap', 'opengl']
# List of XendConfig configuration keys that have no direct equivalent
@@ -865,7 +865,7 @@ class XendConfig(dict):
# add vfb device if it isn't there already
if not self.has_rfb():
dev_config = ['vfb']
- dev_config.append(['type', 'vnc'])
+ dev_config.append(['vnc', '1'])
# copy VNC related params from platform config to vfb dev conf
for key in ['vncpasswd', 'vncunused', 'vncdisplay',
'vnclisten']:
@@ -1470,7 +1470,8 @@ class XendConfig(dict):
# collapse other config into devinfo for things
# such as vncpasswd, vncunused, etc.
dev_info.update(console_other_config)
- dev_info['type'] = console_other_config.get('type', 'vnc')
+ dev_info['vnc'] = console_other_config.get('vnc', '0')
+ dev_info['sdl'] = console_other_config.get('sdl', '0')
target['devices'][dev_uuid] = ('vfb', dev_info)
target['console_refs'].append(dev_uuid)
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
index 99111c9ccc..d600a0ec4d 100644
--- a/tools/python/xen/xend/image.py
+++ b/tools/python/xen/xend/image.py
@@ -279,15 +279,16 @@ class ImageHandler:
if dev_type == 'vfb':
if 'keymap' in dev_info:
keymap = dev_info.get('keymap',{})
- vfb_type = dev_info.get('type', {})
- if vfb_type == 'sdl':
+ if int(dev_info.get('vnc', 0)) != 0 :
+ has_vnc = True
+ if int(dev_info.get('sdl', 0)) != 0 :
+ has_sdl = True
+ if has_sdl:
self.display = dev_info.get('display', {})
self.xauthority = dev_info.get('xauthority', {})
opengl = int(dev_info.get('opengl', opengl))
- has_sdl = True
- else:
+ if has_vnc:
vnc_config = dev_info.get('other_config', {})
- has_vnc = True
break
if keymap:
@@ -335,11 +336,12 @@ class ImageHandler:
if int(vnc_config.get('vncunused', 1)) != 0:
ret.append('-vncunused')
- elif has_sdl:
- # SDL is default in QEMU.
+ if has_sdl:
+ ret.append('-sdl')
if int(vmConfig['platform'].get('opengl', opengl)) != 1 :
ret.append('-disable-opengl')
- else:
+
+ if not has_sdl and not has_vnc :
ret.append('-nographic')
if int(vmConfig['platform'].get('monitor', 0)) != 0:
@@ -714,6 +716,8 @@ class HVMImageHandler(ImageHandler):
rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')
+ if not self.display :
+ self.display = ''
self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
("image/device-model", self.device_model),
("image/display", self.display))
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index 8491a5e693..6699c3c7f3 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -350,16 +350,16 @@ gopts.var('irq', val='IRQ',
For example 'irq=7'.
This option may be repeated to add more than one IRQ.""")
-gopts.var('vfb', val="type={vnc,sdl},vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE",
+gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE",
fn=append_value, default=[],
use="""Make the domain a framebuffer backend.
- The backend type should be either sdl or vnc.
- For type=vnc, connect an external vncviewer. The server will listen
+ Both sdl=1 and vnc=1 can be enabled at the same time.
+ For vnc=1, connect an external vncviewer. The server will listen
on ADDR (default 127.0.0.1) on port N+5900. N defaults to the
domain id. If vncunused=1, the server will try to find an arbitrary
unused port above 5900. vncpasswd overrides the XenD configured
default password.
- For type=sdl, a viewer will be started automatically using the
+ For sdl=1, a viewer will be started automatically using the
given DISPLAY and XAUTHORITY, which default to the current user's
ones. OpenGL will be used by default unless opengl is set to 0.
keymap overrides the XendD configured default layout file.""")
@@ -804,11 +804,13 @@ def configure_vfbs(config_devs, vals):
for f in vals.vfb:
d = comma_sep_kv_to_dict(f)
config = ['vfb']
- if not d.has_key("type"):
- d['type'] = 'sdl'
+ #handle the legacy case
+ if d.has_key("type"):
+ d[d['type']] = '1'
+ del d['type']
for (k,v) in d.iteritems():
if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display',
- 'videoram', 'xauthority', 'type', 'vncpasswd',
+ 'videoram', 'xauthority', 'sdl', 'vnc', 'vncpasswd',
'opengl', 'keymap' ]:
err("configuration option %s unknown to vfbs" % k)
config.append([k,v])