[Kimchi-devel] [PATCH 2/4] Support tablet type as input device in VM's XML.
Paulo Vital
pvital at linux.vnet.ibm.com
Mon Aug 25 23:18:28 UTC 2014
From: Eli Qiao <taget at linux.vnet.ibm.com>
Add support to tablet type as input devive into vmtemplate.py to
provide an absolute pointer device. This also helps with getting
a consistent mouse cursor position in VNC.
Signed-off-by: Eli Qiao <taget at linux.vnet.ibm.com>
---
src/kimchi/osinfo.py | 5 +++--
src/kimchi/vmtemplate.py | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 1ad353c..6ee5e48 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -49,11 +49,12 @@ template_specs = {'x86': {'old': dict(common_spec, disk_bus='ide',
nic_model='spapr-vlan',
cdrom_bus='scsi',
kbd_bus='usb', mouse_bus='usb',
- memory=1280),
+ tablet_bus='usb', memory=1280),
'modern': dict(common_spec, disk_bus='virtio',
nic_model='virtio',
cdrom_bus='scsi', kbd_bus='usb',
- mouse_bus='usb', memory=1280)}}
+ mouse_bus='usb', tablet_bus='usb',
+ memory=1280)}}
modern_version_bases = {'x86': {'debian': '6.0', 'ubuntu': '7.10',
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 761bac5..ddb1f35 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -349,12 +349,17 @@ drive=drive-%(bus)s0-1-0,id=%(bus)s0-1-0'/>
keyboard = """
<input type='kbd' bus='%(kbd_bus)s'> </input>
"""
+ tablet = """
+ <input type='tablet' bus='%(kbd_bus)s'> </input>
+ """
input_output = ""
if 'mouse_bus' in self.info.keys():
input_output += mouse % self.info
if 'kbd_bus' in self.info.keys():
input_output += keyboard % self.info
+ if 'tablet_bus' in self.info.keys():
+ input_output += tablet % self.info
if 'sound_model' in self.info.keys():
input_output += sound % self.info
return input_output
--
1.9.3
More information about the Kimchi-devel
mailing list