direct-io.hg

changeset 15483:eaf3aa32fa88

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>
author kfraser@localhost.localdomain
date Fri Jul 06 16:16:57 2007 +0100 (2007-07-06)
parents 89d2192942be
children 5fbe4c7ec743
files tools/examples/xend-config.sxp tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendOptions.py tools/python/xen/xend/server/vfbif.py
line diff
     1.1 --- a/tools/examples/xend-config.sxp	Fri Jul 06 16:12:07 2007 +0100
     1.2 +++ b/tools/examples/xend-config.sxp	Fri Jul 06 16:16:57 2007 +0100
     1.3 @@ -191,3 +191,9 @@
     1.4  # The default password for VNC console on HVM domain.
     1.5  # Empty string is no authentication.
     1.6  (vncpasswd '')
     1.7 +
     1.8 +# The default keymap to use for the VM's virtual keyboard
     1.9 +# when not specififed in VM's configuration
    1.10 +#(keymap 'en-us')
    1.11 +
    1.12 +
     2.1 --- a/tools/python/xen/xend/XendConfig.py	Fri Jul 06 16:12:07 2007 +0100
     2.2 +++ b/tools/python/xen/xend/XendConfig.py	Fri Jul 06 16:16:57 2007 +0100
     2.3 @@ -22,6 +22,7 @@ import types
     2.4  
     2.5  from xen.xend import sxp
     2.6  from xen.xend import uuid
     2.7 +from xen.xend import XendOptions
     2.8  from xen.xend import XendAPIStore
     2.9  from xen.xend.XendError import VmError
    2.10  from xen.xend.XendDevices import XendDevices
    2.11 @@ -392,6 +393,9 @@ class XendConfig(dict):
    2.12  
    2.13      def _platform_sanity_check(self):
    2.14          if self.is_hvm():
    2.15 +            if 'keymap' not in self['platform'] and XendOptions.instance().get_keymap():
    2.16 +                self['platform']['keymap'] = XendOptions.instance().get_keymap()
    2.17 +
    2.18              if 'device_model' not in self['platform']:
    2.19                  self['platform']['device_model'] = DEFAULT_DM
    2.20  
     3.1 --- a/tools/python/xen/xend/XendOptions.py	Fri Jul 06 16:12:07 2007 +0100
     3.2 +++ b/tools/python/xen/xend/XendOptions.py	Fri Jul 06 16:16:57 2007 +0100
     3.3 @@ -278,6 +278,9 @@ class XendOptions:
     3.4          return self.get_config_string('vncpasswd',
     3.5                                       self.vncpasswd_default)
     3.6  
     3.7 +    def get_keymap(self):
     3.8 +        return self.get_config_value('keymap', None)
     3.9 +
    3.10  class XendOptionsFile(XendOptions):
    3.11  
    3.12      """Default path to the config file."""
     4.1 --- a/tools/python/xen/xend/server/vfbif.py	Fri Jul 06 16:12:07 2007 +0100
     4.2 +++ b/tools/python/xen/xend/server/vfbif.py	Fri Jul 06 16:16:57 2007 +0100
     4.3 @@ -76,6 +76,11 @@ class VfbifController(DevController):
     4.4              args += [ "--listen", vnclisten ]
     4.5              if config.has_key("keymap"):
     4.6                  args += ["-k", "%s" % config["keymap"]]
     4.7 +            else:
     4.8 +                xoptions = xen.xend.XendOptions.instance()
     4.9 +                if xoptions.get_keymap():
    4.10 +                    args += ["-k", "%s" % xoptions.get_keymap()]
    4.11 +
    4.12              spawn_detached(args[0], args + std_args, os.environ)
    4.13          elif t == "sdl":
    4.14              args = [xen.util.auxbin.pathTo("xen-sdlfb")]