graphics: Default to unset keymap
qemu and all related hypervisors (xen, vz) haven't needed this in the common case for a very long time, so make keymap=None the default
This commit is contained in:
parent
a33ac92040
commit
fd2fe1249d
|
@ -18,6 +18,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<console type="pty"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<graphics type="vnc" port="-1"/>
|
||||
</devices>
|
||||
</domain>
|
||||
|
|
|
@ -16,6 +16,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<console type="pty"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<graphics type="vnc" port="-1"/>
|
||||
</devices>
|
||||
</domain>
|
||||
|
|
|
@ -34,6 +34,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<console type="pty"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<graphics type="vnc" port="-1"/>
|
||||
</devices>
|
||||
</domain>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</interface>
|
||||
<console type="pty"/>
|
||||
<input type="tablet" bus="usb"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<graphics type="vnc" port="-1"/>
|
||||
</devices>
|
||||
</domain>
|
||||
<domain type="xen">
|
||||
|
@ -45,6 +45,6 @@
|
|||
</interface>
|
||||
<console type="pty"/>
|
||||
<input type="tablet" bus="usb"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<graphics type="vnc" port="-1"/>
|
||||
</devices>
|
||||
</domain>
|
||||
|
|
|
@ -101,15 +101,7 @@ class DeviceGraphics(Device):
|
|||
"keymap", "listen",
|
||||
"passwd", "display", "xauth"]
|
||||
|
||||
def _default_keymap(self, force_local=False):
|
||||
if self.type != "vnc" and self.type != "spice":
|
||||
return None
|
||||
|
||||
if (not force_local and
|
||||
self.conn.check_support(
|
||||
self.conn.SUPPORT_CONN_KEYMAP_AUTODETECT)):
|
||||
return None
|
||||
|
||||
def _get_local_keymap(self):
|
||||
if self._local_keymap == -1:
|
||||
from .. import hostkeymap
|
||||
self._local_keymap = hostkeymap.default_keymap()
|
||||
|
@ -117,13 +109,12 @@ class DeviceGraphics(Device):
|
|||
|
||||
def _set_keymap_converter(self, val):
|
||||
if val == self.KEYMAP_DEFAULT:
|
||||
return self._default_keymap()
|
||||
# Leave it up to the hypervisor
|
||||
return None
|
||||
if val == self.KEYMAP_LOCAL:
|
||||
return self._default_keymap(force_local=True)
|
||||
return self._get_local_keymap()
|
||||
return val
|
||||
keymap = XMLProperty("./@keymap",
|
||||
default_cb=_default_keymap,
|
||||
set_converter=_set_keymap_converter)
|
||||
keymap = XMLProperty("./@keymap", set_converter=_set_keymap_converter)
|
||||
|
||||
def _set_port_converter(self, val):
|
||||
val = _validate_port("Port", val)
|
||||
|
|
|
@ -217,7 +217,6 @@ SUPPORT_CONN_NODEDEV = _make(
|
|||
function="virConnect.listDevices", run_args=(None, 0))
|
||||
SUPPORT_CONN_FINDPOOLSOURCES = _make(
|
||||
function="virConnect.findStoragePoolSources")
|
||||
SUPPORT_CONN_KEYMAP_AUTODETECT = _make(hv_version={"qemu": "0.11.0"})
|
||||
SUPPORT_CONN_GETHOSTNAME = _make(
|
||||
function="virConnect.getHostname", run_args=())
|
||||
SUPPORT_CONN_NETWORK = _make(function="virConnect.listNetworks", run_args=())
|
||||
|
|
Loading…
Reference in New Issue