[Pkg-libvirt-commits] [virt-manager] 07/08: osdict: Fix incorrect usage of virtio input
Guido Guenther
agx at moszumanska.debian.org
Sat Dec 24 00:46:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
agx pushed a commit to annotated tag debian/1%1.4.0-4
in repository virt-manager.
commit 287e5156e82f6f5505f176c2abd592295004856c
Author: Guido Günther <agx at sigxcpu.org>
Date: Sat Dec 24 01:38:33 2016 +0100
osdict: Fix incorrect usage of virtio input
Thanks: Laurent Bigonville for the concise report
Closes: #846356
---
...sdict-Fix-incorrect-usage-of-virtio-input.patch | 81 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 82 insertions(+)
diff --git a/debian/patches/osdict-Fix-incorrect-usage-of-virtio-input.patch b/debian/patches/osdict-Fix-incorrect-usage-of-virtio-input.patch
new file mode 100644
index 0000000..765f375
--- /dev/null
+++ b/debian/patches/osdict-Fix-incorrect-usage-of-virtio-input.patch
@@ -0,0 +1,81 @@
+From: Cole Robinson <crobinso at redhat.com>
+Date: Fri, 29 Jul 2016 13:17:36 -0400
+Subject: osdict: Fix incorrect usage of virtio input
+
+Regression reported with latest libosinfo, when the OS reports
+virtio-input support:
+
+http://www.redhat.com/archives/virt-tools-list/2016-July/msg00109.html
+
+Really our code presently only cares about the USB tablet, so adjust
+our libosinfo lookup to explicitly check for it
+---
+ virtinst/guest.py | 11 +++++------
+ virtinst/osdict.py | 28 ++++++++++++----------------
+ 2 files changed, 17 insertions(+), 22 deletions(-)
+
+diff --git a/virtinst/guest.py b/virtinst/guest.py
+index 957e818..e24e233 100644
+--- a/virtinst/guest.py
++++ b/virtinst/guest.py
+@@ -1031,15 +1031,14 @@ class Guest(XMLBuilder):
+ return False
+ return all([c.model == "none" for c in controllers])
+
+- input_type = self._os_object.default_inputtype()
+- input_bus = self._os_object.default_inputbus()
++ input_type = "mouse"
++ input_bus = "ps2"
+ if self.os.is_xenpv():
+ input_type = VirtualInputDevice.TYPE_MOUSE
+ input_bus = VirtualInputDevice.BUS_XEN
+- elif _usb_disabled() and input_bus == "usb":
+- input_bus = "ps2"
+- if input_type == "tablet":
+- input_type = "mouse"
++ elif self._os_object.supports_usbtablet() and not _usb_disabled():
++ input_type = "tablet"
++ input_bus = "usb"
+
+ for inp in self.get_devices("input"):
+ if (inp.type == inp.TYPE_DEFAULT and
+diff --git a/virtinst/osdict.py b/virtinst/osdict.py
+index 38d626d..8b0ef7b 100644
+--- a/virtinst/osdict.py
++++ b/virtinst/osdict.py
+@@ -457,23 +457,19 @@ class _OsVariant(object):
+ return devname
+ return None
+
+- def default_inputtype(self):
+- if self._os:
+- fltr = libosinfo.Filter()
+- fltr.add_constraint("class", "input")
+- devs = self._os.get_all_devices(fltr)
+- if devs.get_length():
+- return devs.get_nth(0).get_name()
+- return "mouse"
++ def supports_usbtablet(self):
++ if not self._os:
++ return False
+
+- def default_inputbus(self):
+- if self._os:
+- fltr = libosinfo.Filter()
+- fltr.add_constraint("class", "input")
+- devs = self._os.get_all_devices(fltr)
+- if devs.get_length():
+- return devs.get_nth(0).get_bus_type()
+- return "ps2"
++ fltr = libosinfo.Filter()
++ fltr.add_constraint("class", "input")
++ fltr.add_constraint("name", "tablet")
++ devs = self._os.get_all_devices(fltr)
++ for idx in range(devs.get_length()):
++ dev = devs.get_nth(idx)
++ if devs.get_nth(idx).get_bus_type() == "usb":
++ return True
++ return False
+
+ def supports_virtiodisk(self):
+ if self._os:
diff --git a/debian/patches/series b/debian/patches/series
index 34e4e58..a159420 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ Mark-Jessie-as-having-qemu-guest-agent.patch
osdict-Don-t-return-virtio1.0-net-as-a-valid-device-name.patch
We-can-t-clone-a-VM-in-some-scenarios.patch
Use-usr-bin-python.patch
+osdict-Fix-incorrect-usage-of-virtio-input.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/virt-manager.git
More information about the Pkg-libvirt-commits
mailing list