[libvirt PATCH 0/2] remove transitional virtio-input-host support

Ján Tomko (2): qemu: capabilities: do not check for transitional input host qemu: remove support for transitional virtio-input-host src/qemu/qemu_capabilities.c | 2 -- src/qemu/qemu_command.c | 2 -- .../qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args | 2 +- .../qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args | 2 +- tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args | 2 +- 6 files changed, 4 insertions(+), 8 deletions(-) -- 2.31.1

The (non-)transitional version of this device was only present in one upstream QEMU release, then removed by: commit d923e30578a65392e50e530e3a29b2edf5c51c5b virtio-input-host-pci: cleanup types Remove them from probing as well, since they are unlikely to be found. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/qemu/qemu_capabilities.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a71d3b912f..66d5effba8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1316,8 +1316,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-balloon-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "vhost-vsock-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "vhost-vsock-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, - { "virtio-input-host-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, - { "virtio-input-host-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "virtio-scsi-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "virtio-scsi-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "virtio-serial-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, -- 2.31.1

On Tue, Jan 18, 2022 at 04:03:48PM +0100, Ján Tomko wrote:
The (non-)transitional version of this device was only present in one upstream QEMU release, then removed by:
Maybe include the version number for that one QEMU release (4.0) for reference.
+++ b/src/qemu/qemu_capabilities.c @@ -1316,8 +1316,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-balloon-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "vhost-vsock-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "vhost-vsock-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, - { "virtio-input-host-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, - { "virtio-input-host-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "virtio-scsi-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "virtio-scsi-pci-non-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL }, { "virtio-serial-pci-transitional", QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL },
Reviewed-by: Andrea Bolognani <abologna@redhat.com> -- Andrea Bolognani / Red Hat / Virtualization

virtio-input is virtio-1.0 only and these models have been only present in one upstream QEMU release, then removed by: commit d923e30578a65392e50e530e3a29b2edf5c51c5b virtio-input-host-pci: cleanup types https://bugzilla.redhat.com/show_bug.cgi?id=1745868 Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/qemu/qemu_command.c | 2 -- .../qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args | 2 +- .../qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args | 2 +- tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ed9dda4feb..bca867a492 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -900,8 +900,6 @@ qemuBuildVirtioDevGetConfigDev(const virDomainDeviceDef *device, case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: *baseName = "virtio-input-host"; - *has_tmodel = device->data.input->model == VIR_DOMAIN_INPUT_MODEL_VIRTIO_TRANSITIONAL; - *has_ntmodel = device->data.input->model == VIR_DOMAIN_INPUT_MODEL_VIRTIO_NON_TRANSITIONAL; break; case VIR_DOMAIN_INPUT_TYPE_EVDEV: diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args index a1b31c616c..d975250134 100644 --- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args +++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args @@ -45,7 +45,7 @@ QEMU_AUDIO_DRV=none \ -device virtio-9p-pci,disable-legacy=on,disable-modern=off,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.1,addr=0x0 \ -netdev user,id=hostnet0 \ -device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.2,addr=0x0 \ --device virtio-input-host-pci,disable-legacy=on,disable-modern=off,id=input0,evdev=/dev/input/event1234,bus=pci.9,addr=0x0 \ +-device virtio-input-host-pci,id=input0,evdev=/dev/input/event1234,bus=pci.9,addr=0x0 \ -device vhost-scsi-pci,disable-legacy=on,disable-modern=off,wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,bus=pci.6,addr=0x0 \ -device virtio-balloon-pci,disable-legacy=on,disable-modern=off,id=balloon0,bus=pci.7,addr=0x0 \ -object rng-random,id=objrng0,filename=/dev/urandom \ diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args index 8fa615b0b0..96aeaa724a 100644 --- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args @@ -47,7 +47,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"virtio-9p-pci-non-transitional","id":"fs0","fsdev":"fsdev-fs0","mount_tag":"fs1","bus":"pci.1","addr":"0x0"}' \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci-non-transitional","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.2","addr":"0x0"}' \ --device '{"driver":"virtio-input-host-pci-non-transitional","id":"input0","evdev":"/dev/input/event1234","bus":"pci.9","addr":"0x0"}' \ +-device '{"driver":"virtio-input-host-pci","id":"input0","evdev":"/dev/input/event1234","bus":"pci.9","addr":"0x0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"vhost-scsi-pci-non-transitional","wwpn":"naa.5123456789abcde0","vhostfd":"3","id":"hostdev0","bus":"pci.6","addr":"0x0"}' \ -device '{"driver":"virtio-balloon-pci-non-transitional","id":"balloon0","bus":"pci.7","addr":"0x0"}' \ diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args index aaa3f26228..60b0adca11 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args +++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=none \ -device virtio-9p-pci,disable-legacy=off,disable-modern=off,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.2,addr=0x1 \ -netdev user,id=hostnet0 \ -device virtio-net-pci,disable-legacy=off,disable-modern=off,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.2,addr=0x2 \ --device virtio-input-host-pci,disable-legacy=off,disable-modern=off,id=input0,evdev=/dev/input/event1234,bus=pci.2,addr=0x9 \ +-device virtio-input-host-pci,id=input0,evdev=/dev/input/event1234,bus=pci.2,addr=0x9 \ -device vhost-scsi-pci,disable-legacy=off,disable-modern=off,wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,bus=pci.2,addr=0x6 \ -device virtio-balloon-pci,disable-legacy=off,disable-modern=off,id=balloon0,bus=pci.2,addr=0x7 \ -object rng-random,id=objrng0,filename=/dev/urandom \ diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args index 255f8495e4..8d45f0c64e 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args @@ -39,7 +39,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"virtio-9p-pci-transitional","id":"fs0","fsdev":"fsdev-fs0","mount_tag":"fs1","bus":"pci.2","addr":"0x1"}' \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci-transitional","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.2","addr":"0x2"}' \ --device '{"driver":"virtio-input-host-pci-transitional","id":"input0","evdev":"/dev/input/event1234","bus":"pci.2","addr":"0x9"}' \ +-device '{"driver":"virtio-input-host-pci","id":"input0","evdev":"/dev/input/event1234","bus":"pci.2","addr":"0x9"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"vhost-scsi-pci-transitional","wwpn":"naa.5123456789abcde0","vhostfd":"3","id":"hostdev0","bus":"pci.2","addr":"0x6"}' \ -device '{"driver":"virtio-balloon-pci-transitional","id":"balloon0","bus":"pci.2","addr":"0x7"}' \ -- 2.31.1

On Tue, Jan 18, 2022 at 04:03:49PM +0100, Ján Tomko wrote:
virtio-input is virtio-1.0 only and these models have been only present in one upstream QEMU release, then removed by:
Here too, please mention the version (4.0) explicitly.
+++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args @@ -47,7 +47,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"virtio-9p-pci-non-transitional","id":"fs0","fsdev":"fsdev-fs0","mount_tag":"fs1","bus":"pci.1","addr":"0x0"}' \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci-non-transitional","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.2","addr":"0x0"}' \ --device '{"driver":"virtio-input-host-pci-non-transitional","id":"input0","evdev":"/dev/input/event1234","bus":"pci.9","addr":"0x0"}' \ +-device '{"driver":"virtio-input-host-pci","id":"input0","evdev":"/dev/input/event1234","bus":"pci.9","addr":"0x0"}' \
This should be fine guest ABI wise, since the plain version of the device has always been 1.0-only and thus should match the non-transitional version perfectly.
+++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args @@ -39,7 +39,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"virtio-9p-pci-transitional","id":"fs0","fsdev":"fsdev-fs0","mount_tag":"fs1","bus":"pci.2","addr":"0x1"}' \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci-transitional","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.2","addr":"0x2"}' \ --device '{"driver":"virtio-input-host-pci-transitional","id":"input0","evdev":"/dev/input/event1234","bus":"pci.2","addr":"0x9"}' \ +-device '{"driver":"virtio-input-host-pci","id":"input0","evdev":"/dev/input/event1234","bus":"pci.2","addr":"0x9"}' \
This is not right - the device went from transitional to 1.0-only. The problem is actually in the fact that we accepted "virtio-(non-)transitional" as model for this device in the first place, which we shouldn't have. And that was my mistake: when I wrote commit ff3f22e0ece293d3c6f6af58d048724d2fcd8039 Author: Andrea Bolognani <abologna@redhat.com> Date: Wed Mar 6 12:30:25 2019 +0100 qemu: Improve validation for virtio input devices While the parser and schema have to accept all possible models, virtio-(non-)transitional models are only applicable to type=passthrough and should be otherwise rejected. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com> I was clearly under the impression that virtio-input-host-pci-(non-)transitional was a valid QEMU device that it made sense to expose to users. I guess I must have had QEMU 4.0 installed on my machine O:-) So Reviewed-by: Andrea Bolognani <abologna@redhat.com> to the qemuBuildVirtioDevGetConfigDev() hunk, but it needs to come after a patch that fixes qemuValidateDomainDeviceDefInput() so that it rejects virtio-(non-)transitional as model for all virtio input devices and ajusts the test suite accordingly. -- Andrea Bolognani / Red Hat / Virtualization
participants (2)
-
Andrea Bolognani
-
Ján Tomko