From c78ec96933372f903aa6e19ef23ea406ec4c66ce Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 14 Nov 2024 11:20:17 -0500 Subject: [PATCH] virt-install: let libvirt handle `--input bus=default` Our logic here is poorly duplicating libvirt's postparse logic. Notably it will try to add bus=ps2 on non-x86, and misses obscure cases like parallels. https://issues.redhat.com/browse/RHEL-66768 Signed-off-by: Cole Robinson --- .../data/cli/compare/virt-install-many-devices.xml | 4 ++-- tests/data/cli/compare/virt-install-qemu-plain.xml | 2 +- tests/data/cli/compare/virt-install-xen-pv.xml | 4 ++-- virtinst/devices/input.py | 14 -------------- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml index 21e9b5c7e..1a1a0f415 100644 --- a/tests/data/cli/compare/virt-install-many-devices.xml +++ b/tests/data/cli/compare/virt-install-many-devices.xml @@ -723,8 +723,8 @@ - - + + diff --git a/tests/data/cli/compare/virt-install-qemu-plain.xml b/tests/data/cli/compare/virt-install-qemu-plain.xml index 016592164..4c6b7ae1c 100644 --- a/tests/data/cli/compare/virt-install-qemu-plain.xml +++ b/tests/data/cli/compare/virt-install-qemu-plain.xml @@ -51,7 +51,7 @@ - + diff --git a/tests/data/cli/compare/virt-install-xen-pv.xml b/tests/data/cli/compare/virt-install-xen-pv.xml index 8359deab1..d1e11388c 100644 --- a/tests/data/cli/compare/virt-install-xen-pv.xml +++ b/tests/data/cli/compare/virt-install-xen-pv.xml @@ -26,7 +26,7 @@ - + destroy @@ -58,7 +58,7 @@ - + diff --git a/virtinst/devices/input.py b/virtinst/devices/input.py index 1795d448d..8d0815636 100644 --- a/virtinst/devices/input.py +++ b/virtinst/devices/input.py @@ -37,20 +37,6 @@ class DeviceInput(Device): # Default config # ################## - def _default_bus(self, _guest): - if self.type == self.TYPE_TABLET: - return self.BUS_USB - # This is not explicitly stated in the docs, but the example provided - # for evdev inputs does not have a bus type set and libvirt won't - # accept such XML either. - if self.type == self.TYPE_EVDEV: - return None - if self.conn.is_xen(): - return self.BUS_XEN - return self.BUS_PS2 - def set_defaults(self, guest): if not self.type: self.type = self.TYPE_MOUSE - if not self.bus: - self.bus = self._default_bus(guest)