]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Don't downgrade to '-usb' for arm based machines
authorPeter Krempa <pkrempa@redhat.com>
Wed, 21 Feb 2024 16:41:01 +0000 (17:41 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 6 Mar 2024 15:30:37 +0000 (16:30 +0100)
 - 'virt*' machines already don't allow downgrade
 - 'versatilepb' and 'realview' machines use 'pci-ohci' controller with '-usb'
 - all other machines ignore '-usb' (some have sysbus-based USB
   controller which we don't even consider)

For the 'versatilepb' and 'realview' machines libvirt would already
resort to picking either an existing controller model or trying to pick
the one which '-usb' would select and thus fail either way.

All other machine types ignore it.

We can thus remove the fallback for all arm-based machines.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/qemu/qemu_command.c
tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.abi-update.args
tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.args
tests/qemuxmlconfdata/arm-vexpressa9-basic.aarch64-latest.args
tests/qemuxmlconfdata/arm-vexpressa9-nodevs.aarch64-latest.args
tests/qemuxmlconfdata/arm-vexpressa9-virtio.aarch64-latest.args
tests/qemuxmlconfdata/disk-arm-virtio-sd.aarch64-latest.args
tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.args [deleted file]
tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err [new file with mode: 0644]
tests/qemuxmlconftest.c

index 16776bb48477bc39ce91a2e111af53798105d35e..2d6f930756143b23d1d1a202aceea98e57eeef5d 100644 (file)
@@ -2924,7 +2924,7 @@ qemuBuildDomainForbidLegacyUSBController(const virDomainDef *def)
 {
     if (ARCH_IS_X86(def->os.arch) ||
         ARCH_IS_PPC(def->os.arch) ||
-        qemuDomainIsARMVirt(def) ||
+        ARCH_IS_ARM(def->os.arch) ||
         qemuDomainIsRISCVVirt(def))
         return true;
 
index dc67ca5f75555ec220e65b4faaa7ca2999dff28e..a3d0f7a4fcf59690485103c45cb286f38041abbe 100644 (file)
@@ -25,7 +25,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
 -rtc base=utc \
 -no-shutdown \
 -boot strict=on \
--usb \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index dc67ca5f75555ec220e65b4faaa7ca2999dff28e..a3d0f7a4fcf59690485103c45cb286f38041abbe 100644 (file)
@@ -25,7 +25,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
 -rtc base=utc \
 -no-shutdown \
 -boot strict=on \
--usb \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 1ffef8383e42d9f9117c6f9188dc0a8f619d9ee1..72d10a732e2f05c6558e885dd03ef71ede55044e 100644 (file)
@@ -30,7 +30,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armtest/.config \
 -initrd /arm.initrd \
 -append 'console=ttyAMA0,115200n8 rw root=/dev/mmcblk0p3 rootwait physmap.enabled=0' \
 -dtb /arm.dtb \
--usb \
 -drive file=/arm.raw,format=raw,if=sd,index=0 \
 -netdev '{"type":"user","id":"hostnet0"}' \
 -net nic,macaddr=52:54:00:09:a4:37,netdev=hostnet0,model=lan9118,id=net0 \
index 86c0d478490ddf74e8582e5c62ae7754423e540b..de96ada570d2081110620145ae666777e6d9fb67 100644 (file)
@@ -30,7 +30,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armtest/.config \
 -initrd /arm.initrd \
 -append console=ttyAMA0,115200n8 \
 -dtb /arm.dtb \
--usb \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 79b569aa3838d941333d14a465f11746f262af10..b4c295be6bac253fe82fbcd2941f1782dff4fb44 100644 (file)
@@ -31,7 +31,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armtest/.config \
 -append 'console=ttyAMA0,115200n8 rw root=/dev/vda3 rootwait physmap.enabled=0' \
 -dtb /arm.dtb \
 -device '{"driver":"virtio-serial-device","id":"virtio-serial0"}' \
--usb \
 -blockdev '{"driver":"file","filename":"/arm.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
 -device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \
index 2572b51f95cacc37181c1b38e0d40f2f0e01d43a..3328189b44c1a73b363d5f6049360065477cbfdb 100644 (file)
@@ -30,7 +30,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armtest/.config \
 -initrd /arm.initrd \
 -append 'console=ttyAMA0,115200n8 rw root=/dev/vda3 rootwait physmap.enabled=0' \
 -dtb /arm.dtb \
--usb \
 -drive file=/arm-sd.qcow2,format=qcow2,if=sd,index=0 \
 -drive file.driver=nbd,file.server.type=inet,file.server.host=localhost,file.server.port=10809,file.export=export,format=qcow2,if=sd,index=1 \
 -drive file.driver=gluster,file.volume=Volume3,file.path=Image.qcow2,file.server.0.type=inet,file.server.0.host=example.org,file.server.0.port=6000,file.server.1.type=inet,file.server.1.host=example.org,file.server.1.port=24007,file.server.2.type=unix,file.server.2.path=/path/to/sock,file.debug=4,format=qcow2,if=sd,index=2 \
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.args
deleted file mode 100644 (file)
index d7bad74..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \
-/usr/bin/qemu-system-armv7l \
--name guest=armv7ltest,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-armv7ltest/master-key.aes"}' \
--machine versatilepb,usb=off,dump-guest-core=off,memory-backend=versatile.ram \
--accel tcg \
--cpu arm926 \
--m size=1048576k \
--object '{"qom-type":"memory-backend-ram","id":"versatile.ram","size":1073741824}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot strict=on \
--usb \
--audiodev '{"id":"audio1","driver":"none"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err
new file mode 100644 (file)
index 0000000..7a71aa1
--- /dev/null
@@ -0,0 +1 @@
+unsupported configuration: no model provided for USB controller
index f461e65023612041863c782bffac078b9d591caf..af77b9abdfcd42827acd80f03112b343fed597da 100644 (file)
@@ -1919,6 +1919,7 @@ mymain(void)
     DO_TEST_FULL("usb-controller-default-unavailable-versatilepb-armv7l", ".armv7l-latest",
                  ARG_CAPS_ARCH, "armv7l",
                  ARG_CAPS_VER, "latest",
+                 ARG_FLAGS, FLAG_EXPECT_FAILURE,
                  ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST,
                  ARG_END);