]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Don't downgrade to '-usb' for ppc 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:36 +0000 (16:30 +0100)
 - 'pseries' machines already don't allow downgrade
 - 'g3beige' and 'mac99' machines use 'pci-ohci' controller with '-usb'
 - all other machines ignore '-usb'

For 'g3beige' and 'mac99' libvirt already has 'pci-ohci' as contoller it
would select as one of the options when picking a model, thus it's
impossible to reach situation when '-usb' would be honoured.

All other machine types ignore it.

We can thus remove the fallback for all ppc-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/usb-controller-default-unavailable-g3beige.ppc64-latest.args [deleted file]
tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.err [new file with mode: 0644]
tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.args [deleted file]
tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.err [new file with mode: 0644]
tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.args [deleted file]
tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.err [new file with mode: 0644]
tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.args [deleted file]
tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.err [new file with mode: 0644]
tests/qemuxmlconftest.c

index 19eabb49cab140b315fb63dfc594fe6b63d093f2..16776bb48477bc39ce91a2e111af53798105d35e 100644 (file)
@@ -2923,8 +2923,8 @@ static bool
 qemuBuildDomainForbidLegacyUSBController(const virDomainDef *def)
 {
     if (ARCH_IS_X86(def->os.arch) ||
+        ARCH_IS_PPC(def->os.arch) ||
         qemuDomainIsARMVirt(def) ||
-        qemuDomainIsPSeries(def) ||
         qemuDomainIsRISCVVirt(def))
         return true;
 
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.args
deleted file mode 100644 (file)
index d32243e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-ppc64 \
--name guest=QEMUGuest1,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine g3beige,usb=off,dump-guest-core=off,memory-backend=ppc_heathrow.ram \
--accel tcg \
--cpu g3 \
--m size=262144k \
--object '{"qom-type":"memory-backend-ram","id":"ppc_heathrow.ram","size":268435456}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--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"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.err
new file mode 100644 (file)
index 0000000..7a71aa1
--- /dev/null
@@ -0,0 +1 @@
+unsupported configuration: no model provided for USB controller
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.args
deleted file mode 100644 (file)
index 1f025e4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-ppc64 \
--name guest=QEMUGuest1,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine mac99,usb=off,dump-guest-core=off,memory-backend=ppc_core99.ram \
--accel tcg \
--cpu ppc64 \
--m size=262144k \
--object '{"qom-type":"memory-backend-ram","id":"ppc_core99.ram","size":268435456}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--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"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.err
new file mode 100644 (file)
index 0000000..7a71aa1
--- /dev/null
@@ -0,0 +1 @@
+unsupported configuration: no model provided for USB controller
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.args
deleted file mode 100644 (file)
index 8a9bc37..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-ppc \
--name guest=QEMUGuest1,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine mac99,usb=off,dump-guest-core=off,memory-backend=ppc_core99.ram \
--accel tcg \
--m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"ppc_core99.ram","size":224395264}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--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"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.err
new file mode 100644 (file)
index 0000000..7a71aa1
--- /dev/null
@@ -0,0 +1 @@
+unsupported configuration: no model provided for USB controller
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.args
deleted file mode 100644 (file)
index cde8063..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-ppc64 \
--name guest=QEMUGuest1,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine powernv9,usb=off,dump-guest-core=off,memory-backend=pnv.ram \
--accel tcg \
--cpu POWER9 \
--m size=262144k \
--object '{"qom-type":"memory-backend-ram","id":"pnv.ram","size":268435456}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--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"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.err
new file mode 100644 (file)
index 0000000..7a71aa1
--- /dev/null
@@ -0,0 +1 @@
+unsupported configuration: no model provided for USB controller
index 5792e525dacfb3fabe2f8b46e5147b719973584a..f461e65023612041863c782bffac078b9d591caf 100644 (file)
@@ -1955,6 +1955,7 @@ mymain(void)
     DO_TEST_FULL("usb-controller-default-unavailable-g3beige", ".ppc64-latest",
                  ARG_CAPS_ARCH, "ppc64",
                  ARG_CAPS_VER, "latest",
+                 ARG_FLAGS, FLAG_EXPECT_FAILURE,
                  ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST,
                  ARG_END);
 
@@ -1966,6 +1967,7 @@ mymain(void)
     DO_TEST_FULL("usb-controller-default-unavailable-mac99", ".ppc64-latest",
                  ARG_CAPS_ARCH, "ppc64",
                  ARG_CAPS_VER, "latest",
+                 ARG_FLAGS, FLAG_EXPECT_FAILURE,
                  ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST,
                  ARG_END);
 
@@ -1977,6 +1979,7 @@ mymain(void)
     DO_TEST_FULL("usb-controller-default-unavailable-mac99ppc", ".ppc-latest",
                  ARG_CAPS_ARCH, "ppc",
                  ARG_CAPS_VER, "latest",
+                 ARG_FLAGS, FLAG_EXPECT_FAILURE,
                  ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST,
                  ARG_END);
 
@@ -1988,6 +1991,7 @@ mymain(void)
     DO_TEST_FULL("usb-controller-default-unavailable-powernv9", ".ppc64-latest",
                  ARG_CAPS_ARCH, "ppc64",
                  ARG_CAPS_VER, "latest",
+                 ARG_FLAGS, FLAG_EXPECT_FAILURE,
                  ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST,
                  ARG_END);
     DO_TEST_CAPS_LATEST("usb-none");