aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-06 16:16:57 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-06 16:16:57 +0100
commitc4d1247d009d8c0327629fe4b13e089dca87d0c6 (patch)
tree473dab57cd7c77a4a7787f66130754dc3a51e54e /tools
parentbe259653f3f1713426ddea9436bffe998b54ae78 (diff)
downloadxen-c4d1247d009d8c0327629fe4b13e089dca87d0c6.tar.gz
xen-c4d1247d009d8c0327629fe4b13e089dca87d0c6.tar.bz2
xen-c4d1247d009d8c0327629fe4b13e089dca87d0c6.zip
hvm: Add global default keymap setting
Add global default keymap setting to be used when a VM does not have a keymap configuration set. Signed-off-by: Pat Campbell <plc@novell.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/examples/xend-config.sxp6
-rw-r--r--tools/python/xen/xend/XendConfig.py4
-rw-r--r--tools/python/xen/xend/XendOptions.py3
-rw-r--r--tools/python/xen/xend/server/vfbif.py5
4 files changed, 18 insertions, 0 deletions
diff --git a/tools/examples/xend-config.sxp b/tools/examples/xend-config.sxp
index aaddbee076..adbb9e6b69 100644
--- a/tools/examples/xend-config.sxp
+++ b/tools/examples/xend-config.sxp
@@ -191,3 +191,9 @@
# The default password for VNC console on HVM domain.
# Empty string is no authentication.
(vncpasswd '')
+
+# The default keymap to use for the VM's virtual keyboard
+# when not specififed in VM's configuration
+#(keymap 'en-us')
+
+
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 17628f337a..0773724919 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -22,6 +22,7 @@ import types
from xen.xend import sxp
from xen.xend import uuid
+from xen.xend import XendOptions
from xen.xend import XendAPIStore
from xen.xend.XendError import VmError
from xen.xend.XendDevices import XendDevices
@@ -392,6 +393,9 @@ class XendConfig(dict):
def _platform_sanity_check(self):
if self.is_hvm():
+ if 'keymap' not in self['platform'] and XendOptions.instance().get_keymap():
+ self['platform']['keymap'] = XendOptions.instance().get_keymap()
+
if 'device_model' not in self['platform']:
self['platform']['device_model'] = DEFAULT_DM
diff --git a/tools/python/xen/xend/XendOptions.py b/tools/python/xen/xend/XendOptions.py
index 73de5a39c3..af09220782 100644
--- a/tools/python/xen/xend/XendOptions.py
+++ b/tools/python/xen/xend/XendOptions.py
@@ -278,6 +278,9 @@ class XendOptions:
return self.get_config_string('vncpasswd',
self.vncpasswd_default)
+ def get_keymap(self):
+ return self.get_config_value('keymap', None)
+
class XendOptionsFile(XendOptions):
"""Default path to the config file."""
diff --git a/tools/python/xen/xend/server/vfbif.py b/tools/python/xen/xend/server/vfbif.py
index cbef190248..eb1990e64f 100644
--- a/tools/python/xen/xend/server/vfbif.py
+++ b/tools/python/xen/xend/server/vfbif.py
@@ -76,6 +76,11 @@ class VfbifController(DevController):
args += [ "--listen", vnclisten ]
if config.has_key("keymap"):
args += ["-k", "%s" % config["keymap"]]
+ else:
+ xoptions = xen.xend.XendOptions.instance()
+ if xoptions.get_keymap():
+ args += ["-k", "%s" % xoptions.get_keymap()]
+
spawn_detached(args[0], args + std_args, os.environ)
elif t == "sdl":
args = [xen.util.auxbin.pathTo("xen-sdlfb")]