This device was virtio 1.0-only so adding the (non-)transitional model did not make sense and it was only present in QEMU 4.0. Report a validation error for both of the users that will ever hit this code path and Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx> --- src/qemu/qemu_validate.c | 26 +++++-------------- .../virtio-non-transitional.x86_64-3.1.0.args | 4 +-- ...virtio-non-transitional.x86_64-latest.args | 4 +-- .../virtio-non-transitional.xml | 3 --- .../virtio-transitional.x86_64-3.1.0.args | 3 +-- .../virtio-transitional.x86_64-latest.args | 3 +-- .../qemuxml2argvdata/virtio-transitional.xml | 3 --- .../virtio-non-transitional.x86_64-latest.xml | 11 +------- .../virtio-transitional.x86_64-latest.xml | 6 +---- 9 files changed, 12 insertions(+), 51 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3a69733f81..a4a6608779 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4699,29 +4699,15 @@ qemuValidateDomainDeviceDefInput(const virDomainInputDef *input, if (input->bus != VIR_DOMAIN_INPUT_BUS_VIRTIO) return 0; - /* Only type=passthrough supports model=virtio-(non-)transitional */ + /* model=virtio-(non-)transitional is unsupported */ switch ((virDomainInputModel)input->model) { case VIR_DOMAIN_INPUT_MODEL_VIRTIO_TRANSITIONAL: case VIR_DOMAIN_INPUT_MODEL_VIRTIO_NON_TRANSITIONAL: - switch ((virDomainInputType)input->type) { - case VIR_DOMAIN_INPUT_TYPE_MOUSE: - case VIR_DOMAIN_INPUT_TYPE_TABLET: - case VIR_DOMAIN_INPUT_TYPE_KBD: - case VIR_DOMAIN_INPUT_TYPE_EVDEV: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("virtio (non-)transitional models are not " - "supported for input type=%s"), - virDomainInputTypeToString(input->type)); - return -1; - case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: - break; - case VIR_DOMAIN_INPUT_TYPE_LAST: - default: - virReportEnumRangeError(virDomainInputType, - input->type); - return -1; - } - break; + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("virtio (non-)transitional models are not " + "supported for input type=%s"), + virDomainInputTypeToString(input->type)); + return -1; case VIR_DOMAIN_INPUT_MODEL_VIRTIO: case VIR_DOMAIN_INPUT_MODEL_DEFAULT: break; 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..2d0e568bb0 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 @@ -36,7 +36,6 @@ QEMU_AUDIO_DRV=none \ -device pcie-root-port,port=15,chassis=8,id=pci.8,bus=pcie.0,addr=0x1.0x7 \ -device pcie-root-port,port=16,chassis=9,id=pci.9,bus=pcie.0,multifunction=on,addr=0x2 \ -device pcie-root-port,port=17,chassis=10,id=pci.10,bus=pcie.0,addr=0x2.0x1 \ --device pcie-root-port,port=18,chassis=11,id=pci.11,bus=pcie.0,addr=0x2.0x2 \ -device virtio-scsi-pci,disable-legacy=on,disable-modern=off,id=scsi0,bus=pci.4,addr=0x0 \ -device virtio-serial-pci,disable-legacy=on,disable-modern=off,id=virtio-serial0,bus=pci.3,addr=0x0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ @@ -45,11 +44,10 @@ 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 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 \ -device virtio-rng-pci,disable-legacy=on,disable-modern=off,rng=objrng0,id=rng0,bus=pci.8,addr=0x0 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device vhost-vsock-pci,disable-legacy=on,disable-modern=off,id=vsock0,guest-cid=4,vhostfd=6789,bus=pci.10,addr=0x0 \ +-device vhost-vsock-pci,disable-legacy=on,disable-modern=off,id=vsock0,guest-cid=4,vhostfd=6789,bus=pci.9,addr=0x0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args index 8fa615b0b0..541c074871 100644 --- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args @@ -37,7 +37,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"pcie-root-port","port":15,"chassis":8,"id":"pci.8","bus":"pcie.0","addr":"0x1.0x7"}' \ -device '{"driver":"pcie-root-port","port":16,"chassis":9,"id":"pci.9","bus":"pcie.0","multifunction":true,"addr":"0x2"}' \ -device '{"driver":"pcie-root-port","port":17,"chassis":10,"id":"pci.10","bus":"pcie.0","addr":"0x2.0x1"}' \ --device '{"driver":"pcie-root-port","port":18,"chassis":11,"id":"pci.11","bus":"pcie.0","addr":"0x2.0x2"}' \ -device '{"driver":"virtio-scsi-pci-non-transitional","id":"scsi0","bus":"pci.4","addr":"0x0"}' \ -device '{"driver":"virtio-serial-pci-non-transitional","id":"virtio-serial0","bus":"pci.3","addr":"0x0"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ @@ -47,12 +46,11 @@ 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"}' \ -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"}' \ -object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"}' \ -device '{"driver":"virtio-rng-pci-non-transitional","rng":"objrng0","id":"rng0","bus":"pci.8","addr":"0x0"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-pci-non-transitional","id":"vsock0","guest-cid":4,"vhostfd":"6789","bus":"pci.10","addr":"0x0"}' \ +-device '{"driver":"vhost-vsock-pci-non-transitional","id":"vsock0","guest-cid":4,"vhostfd":"6789","bus":"pci.9","addr":"0x0"}' \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.xml b/tests/qemuxml2argvdata/virtio-non-transitional.xml index 1d7ee6bfe6..9331cd7ea2 100644 --- a/tests/qemuxml2argvdata/virtio-non-transitional.xml +++ b/tests/qemuxml2argvdata/virtio-non-transitional.xml @@ -25,9 +25,6 @@ <source dir='/export/fs1'/> <target dir='fs1'/> </filesystem> - <input type='passthrough' bus='virtio' model='virtio-non-transitional'> - <source evdev='/dev/input/event1234'/> - </input> <controller type='virtio-serial' model='virtio-non-transitional'/> <controller type='scsi' model='virtio-non-transitional'/> <controller type='usb' model='none'/> 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..83bb5d137d 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args +++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args @@ -37,11 +37,10 @@ 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 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 \ -device virtio-rng-pci,disable-legacy=off,disable-modern=off,rng=objrng0,id=rng0,bus=pci.2,addr=0x8 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device vhost-vsock-pci,disable-legacy=off,disable-modern=off,id=vsock0,guest-cid=4,vhostfd=6789,bus=pci.2,addr=0xa \ +-device vhost-vsock-pci,disable-legacy=off,disable-modern=off,id=vsock0,guest-cid=4,vhostfd=6789,bus=pci.2,addr=0x9 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args index 255f8495e4..6d18698ec7 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args @@ -39,12 +39,11 @@ 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"}' \ -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"}' \ -object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"}' \ -device '{"driver":"virtio-rng-pci-transitional","rng":"objrng0","id":"rng0","bus":"pci.2","addr":"0x8"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-pci-transitional","id":"vsock0","guest-cid":4,"vhostfd":"6789","bus":"pci.2","addr":"0xa"}' \ +-device '{"driver":"vhost-vsock-pci-transitional","id":"vsock0","guest-cid":4,"vhostfd":"6789","bus":"pci.2","addr":"0x9"}' \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-transitional.xml b/tests/qemuxml2argvdata/virtio-transitional.xml index 31551ab69f..5c89162eae 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.xml +++ b/tests/qemuxml2argvdata/virtio-transitional.xml @@ -25,9 +25,6 @@ <source dir='/export/fs1'/> <target dir='fs1'/> </filesystem> - <input type='passthrough' bus='virtio' model='virtio-transitional'> - <source evdev='/dev/input/event1234'/> - </input> <controller type='virtio-serial' model='virtio-transitional'/> <controller type='scsi' model='virtio-transitional'/> <controller type='usb' model='none'/> diff --git a/tests/qemuxml2xmloutdata/virtio-non-transitional.x86_64-latest.xml b/tests/qemuxml2xmloutdata/virtio-non-transitional.x86_64-latest.xml index f100819fa9..26f6c6d34e 100644 --- a/tests/qemuxml2xmloutdata/virtio-non-transitional.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/virtio-non-transitional.x86_64-latest.xml @@ -84,11 +84,6 @@ <target chassis='10' port='0x11'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> </controller> - <controller type='pci' index='11' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='11' port='0x12'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> - </controller> <filesystem type='mount' accessmode='passthrough' model='virtio-non-transitional'> <source dir='/export/fs1'/> <target dir='fs1'/> @@ -99,10 +94,6 @@ <model type='virtio-non-transitional'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </interface> - <input type='passthrough' bus='virtio' model='virtio-non-transitional'> - <source evdev='/dev/input/event1234'/> - <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/> - </input> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> @@ -119,7 +110,7 @@ </rng> <vsock model='virtio-non-transitional'> <cid auto='no' address='4'/> - <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/> </vsock> </devices> </domain> diff --git a/tests/qemuxml2xmloutdata/virtio-transitional.x86_64-latest.xml b/tests/qemuxml2xmloutdata/virtio-transitional.x86_64-latest.xml index 8928809e91..8e9ecd8cf3 100644 --- a/tests/qemuxml2xmloutdata/virtio-transitional.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/virtio-transitional.x86_64-latest.xml @@ -58,10 +58,6 @@ <model type='virtio-transitional'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> </interface> - <input type='passthrough' bus='virtio' model='virtio-transitional'> - <source evdev='/dev/input/event1234'/> - <address type='pci' domain='0x0000' bus='0x02' slot='0x09' function='0x0'/> - </input> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> @@ -78,7 +74,7 @@ </rng> <vsock model='virtio-transitional'> <cid auto='no' address='4'/> - <address type='pci' domain='0x0000' bus='0x02' slot='0x0a' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x09' function='0x0'/> </vsock> </devices> </domain> -- 2.31.1