ia64/xen-unstable
changeset 18119:34ad9e2c0d10
xend: Fix keymap handling
Patch allows keymap to be specified inside vfb description and
allows VM configured keymap setting to override XenD default
Signed-off-by: Pat Campbell <plc@novell.com>
Patch allows keymap to be specified inside vfb description and
allows VM configured keymap setting to override XenD default
Signed-off-by: Pat Campbell <plc@novell.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Jul 21 09:47:07 2008 +0100 (2008-07-21) |
parents | 978ffdd19c0f |
children | c433ee4844fb |
files | tools/python/xen/xend/image.py tools/python/xen/xm/create.py |
line diff
1.1 --- a/tools/python/xen/xend/image.py Mon Jul 21 09:46:17 2008 +0100 1.2 +++ b/tools/python/xen/xend/image.py Mon Jul 21 09:47:07 2008 +0100 1.3 @@ -265,9 +265,12 @@ class ImageHandler: 1.4 has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0 1.5 has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0 1.6 opengl = 1 1.7 + keymap = vmConfig['platform'].get("keymap") 1.8 for dev_uuid in vmConfig['console_refs']: 1.9 dev_type, dev_info = vmConfig['devices'][dev_uuid] 1.10 if dev_type == 'vfb': 1.11 + if 'keymap' in dev_info: 1.12 + keymap = dev_info.get('keymap',{}) 1.13 vfb_type = dev_info.get('type', {}) 1.14 if vfb_type == 'sdl': 1.15 self.display = dev_info.get('display', {}) 1.16 @@ -279,7 +282,6 @@ class ImageHandler: 1.17 has_vnc = True 1.18 break 1.19 1.20 - keymap = vmConfig['platform'].get("keymap") 1.21 if keymap: 1.22 ret.append("-k") 1.23 ret.append(keymap)
2.1 --- a/tools/python/xen/xm/create.py Mon Jul 21 09:46:17 2008 +0100 2.2 +++ b/tools/python/xen/xm/create.py Mon Jul 21 09:47:07 2008 +0100 2.3 @@ -325,7 +325,7 @@ gopts.var('irq', val='IRQ', 2.4 For example 'irq=7'. 2.5 This option may be repeated to add more than one IRQ.""") 2.6 2.7 -gopts.var('vfb', val="type={vnc,sdl},vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1", 2.8 +gopts.var('vfb', val="type={vnc,sdl},vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE", 2.9 fn=append_value, default=[], 2.10 use="""Make the domain a framebuffer backend. 2.11 The backend type should be either sdl or vnc. 2.12 @@ -336,7 +336,8 @@ gopts.var('vfb', val="type={vnc,sdl},vnc 2.13 default password. 2.14 For type=sdl, a viewer will be started automatically using the 2.15 given DISPLAY and XAUTHORITY, which default to the current user's 2.16 - ones. OpenGL will be used by default unless opengl is set to 0.""") 2.17 + ones. OpenGL will be used by default unless opengl is set to 0. 2.18 + keymap overrides the XendD configured default layout file.""") 2.19 2.20 gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \ 2.21 "backend=DOM,vifname=NAME,rate=RATE,model=MODEL,accel=ACCEL", 2.22 @@ -741,7 +742,7 @@ def configure_vfbs(config_devs, vals): 2.23 for (k,v) in d.iteritems(): 2.24 if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display', 2.25 'videoram', 'xauthority', 'type', 'vncpasswd', 2.26 - 'opengl' ]: 2.27 + 'opengl', 'keymap' ]: 2.28 err("configuration option %s unknown to vfbs" % k) 2.29 config.append([k,v]) 2.30 if not d.has_key("keymap"):