# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183735017 -3600
# Node ID eaf3aa32fa88e05b7b68dee41bb0d20fc4f4bf91
# Parent 89d2192942befb0daf56e730be61d3a3c06926dd
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@xxxxxxxxxx>
---
tools/examples/xend-config.sxp | 6 ++++++
tools/python/xen/xend/XendConfig.py | 4 ++++
tools/python/xen/xend/XendOptions.py | 3 +++
tools/python/xen/xend/server/vfbif.py | 5 +++++
4 files changed, 18 insertions(+)
diff -r 89d2192942be -r eaf3aa32fa88 tools/examples/xend-config.sxp
--- a/tools/examples/xend-config.sxp Fri Jul 06 16:12:07 2007 +0100
+++ b/tools/examples/xend-config.sxp Fri Jul 06 16:16:57 2007 +0100
@@ -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 -r 89d2192942be -r eaf3aa32fa88 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py Fri Jul 06 16:12:07 2007 +0100
+++ b/tools/python/xen/xend/XendConfig.py Fri Jul 06 16:16:57 2007 +0100
@@ -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 -r 89d2192942be -r eaf3aa32fa88 tools/python/xen/xend/XendOptions.py
--- a/tools/python/xen/xend/XendOptions.py Fri Jul 06 16:12:07 2007 +0100
+++ b/tools/python/xen/xend/XendOptions.py Fri Jul 06 16:16:57 2007 +0100
@@ -277,6 +277,9 @@ class XendOptions:
def get_vncpasswd_default(self):
return self.get_config_string('vncpasswd',
self.vncpasswd_default)
+
+ def get_keymap(self):
+ return self.get_config_value('keymap', None)
class XendOptionsFile(XendOptions):
diff -r 89d2192942be -r eaf3aa32fa88 tools/python/xen/xend/server/vfbif.py
--- a/tools/python/xen/xend/server/vfbif.py Fri Jul 06 16:12:07 2007 +0100
+++ b/tools/python/xen/xend/server/vfbif.py Fri Jul 06 16:16:57 2007 +0100
@@ -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")]
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|