[PATCH 00/31] qemu: Improve handling of architecture-specific defaults (USB and PCI)

Just like the series dealing with [SCSI] from last month, this is an effort to complete work that I had started in early 2024 ([v2], [v1]) and then promptly forgot about. Dealing with USB controllers is a lot easier compared to a year and a half ago because Peter has already brought some much-needed sanity to their handling in the meantime, including finally removing all uses of -usb, but there's still room for improvement. Looking at USB controllers made me realize that we were doing things incorrectly or suboptimally on the PCI side as well, so there are a number of changes in that part of libvirt too. Since USB controllers are PCI devices, some of the changes in one area directly affect the other one and it would have been challening to separate these patches into two smaller series in a way that would make sense, so unfortunately you get a single big one instead. Sorry. [SCSI] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/AL6GJ... [v2] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/FZ6BT... [v1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/G53MR... Andrea Bolognani (31): tests: Fix typo in usb-controller-nec-xhci-autoassign tests: Drop coverage for versatilepb on aarch64 tests: Don't use memballoon=none for minimal tests tests: Don't set PCI address in usb-controller-default tests tests: Minimize usb-controller tests tests: Rename usb-controller-implicit-* tests: Expand coverage for automatic/default USB controllers tests: Fix some usb-controller-*-unavailable cases qemu: Check for pci-ohci availability tests: Use realview-eb instead of realview-pbx-a9 qemu: Fix PCI/USB handling for Arm realview boards tests: Add coverage for PCI use with isapc qemu: Don't add memballoon to isapc qemu: Introduce qemuDomainNetIsPCI() qemu: Prevent use of PCI devices when PCI is not supported qemu: Validate presence of PCI support qemu: Update qemuDomainSupportsPCI() qemu: Add sanity checks for auto-added PCI and USB controllers qemu: Ensure USB controllers have a PCI address assigned qemu: Always default to no USB controller on s390x qemu: Drop skip for USB controllers on s390x qemu: Fold check into qemuBuildSkipController() qemu: Validate USB controllers earlier qemu: Add qemuDomainDefaultUSBControllerModel() qemu: Add qemuDomainDefaultUSBControllerModelAutoAdded() qemu: Clean up qemuDomainDefaultUSBControllerModel() qemu: Use qemu-xhci by default on RISC-V qemu: Allow nec-xhci as fallback for modern architectures qemu: Remove fallback to piix3-uhci for Arm virt guests qemu: Finish cleaning up qemuDomainDefaultUSBControllerModel() news: Update for USB controller model selection improvements NEWS.rst | 6 + src/qemu/qemu_command.c | 86 +--------- src/qemu/qemu_domain.c | 151 +++++++++++++++++- src/qemu/qemu_domain.h | 5 + src/qemu/qemu_domain_address.c | 80 ++++++++-- src/qemu/qemu_postparse.c | 137 +++++++--------- src/qemu/qemu_validate.c | 83 +++++++++- .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 5 +- ...with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 5 +- ...otplug-base-ccw-live-with-2-ccw-virtio.xml | 5 +- ...-with-ccw-virtio+ccw-virtio-2-explicit.xml | 5 +- ...-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 5 +- ...uhotplug-base-ccw-live-with-ccw-virtio.xml | 5 +- .../qemuhotplug-base-ccw-live.xml | 5 +- ...ousb-minimal.aarch64-latest.abi-update.xml | 1 - .../aarch64-nousb-minimal.aarch64-latest.xml | 1 - .../qemuxmlconfdata/aarch64-nousb-minimal.xml | 1 - ...iew-minimal.aarch64-latest.abi-update.args | 4 +- ...view-minimal.aarch64-latest.abi-update.xml | 8 +- ...rch64-realview-minimal.aarch64-latest.args | 4 +- ...arch64-realview-minimal.aarch64-latest.xml | 8 +- .../aarch64-realview-minimal.xml | 3 +- ...epb-minimal.aarch64-latest.abi-update.args | 32 ---- ...lepb-minimal.aarch64-latest.abi-update.xml | 25 --- ...64-versatilepb-minimal.aarch64-latest.args | 32 ---- ...h64-versatilepb-minimal.aarch64-latest.xml | 25 --- ...lepb-minimal.armv7l-latest.abi-update.args | 2 +- ...ilepb-minimal.armv7l-latest.abi-update.xml | 3 +- ...v7l-versatilepb-minimal.armv7l-latest.args | 2 +- ...mv7l-versatilepb-minimal.armv7l-latest.xml | 3 +- .../armv7l-versatilepb-minimal.xml | 1 - .../isapc-pci.x86_64-latest.err | 1 + ...roller-default-isapc.xml => isapc-pci.xml} | 7 +- tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args | 2 +- tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml | 2 +- ...c-mac99-minimal.ppc-latest.abi-update.args | 2 +- ...pc-mac99-minimal.ppc-latest.abi-update.xml | 2 +- .../ppc-mac99-minimal.ppc-latest.args | 2 +- .../ppc-mac99-minimal.ppc-latest.xml | 2 +- .../ppce500-serial.ppc-latest.args | 2 +- .../ppce500-serial.ppc-latest.xml | 2 +- ...ault-models.riscv64-latest.abi-update.args | 15 +- ...fault-models.riscv64-latest.abi-update.xml | 26 ++- ...64-virt-default-models.riscv64-latest.args | 15 +- ...v64-virt-default-models.riscv64-latest.xml | 26 ++- .../s390-usb-address.s390x-latest.xml | 6 +- ...oller-automatic-i440fx.x86_64-latest.args} | 0 ...roller-automatic-i440fx.x86_64-latest.xml} | 0 ...ml => usb-controller-automatic-i440fx.xml} | 2 - ...roller-automatic-isapc.x86_64-latest.args} | 0 ...troller-automatic-isapc.x86_64-latest.xml} | 0 ...xml => usb-controller-automatic-isapc.xml} | 2 - ...atic-pseries.ppc64-latest.abi-update.args} | 1 - ...matic-pseries.ppc64-latest.abi-update.xml} | 13 +- ...oller-automatic-pseries.ppc64-latest.args} | 1 - ...roller-automatic-pseries.ppc64-latest.xml} | 11 +- ...l => usb-controller-automatic-pseries.xml} | 8 +- ...ntroller-automatic-q35.x86_64-latest.args} | 0 ...ontroller-automatic-q35.x86_64-latest.xml} | 0 ...5.xml => usb-controller-automatic-q35.xml} | 2 - ...er-automatic-realview.aarch64-latest.args} | 4 +- ...ler-automatic-realview.aarch64-latest.xml} | 4 +- ... => usb-controller-automatic-realview.xml} | 2 +- ...troller-automatic-s390x.s390x-latest.args} | 11 +- ...ntroller-automatic-s390x.s390x-latest.xml} | 15 +- .../usb-controller-automatic-s390x.xml | 13 ++ ...lable-pseries.ppc64-latest.abi-update.err} | 0 ...atic-unavailable-pseries.ppc64-latest.err} | 0 ...ntroller-automatic-unavailable-pseries.xml | 1 + ...utomatic-unavailable-q35.x86_64-latest.xml | 2 +- ...b-controller-automatic-unavailable-q35.xml | 7 - ...c-unavailable-realview.aarch64-latest.err} | 0 ...troller-automatic-unavailable-realview.xml | 1 + ...unavailable-versatilepb.armv7l-latest.err} | 0 ...ller-automatic-unavailable-versatilepb.xml | 1 + ...-automatic-versatilepb.armv7l-latest.args} | 2 +- ...r-automatic-versatilepb.armv7l-latest.xml} | 4 +- ... usb-controller-automatic-versatilepb.xml} | 0 ...utomatic-virt-aarch64.aarch64-latest.args} | 20 +-- ...automatic-virt-aarch64.aarch64-latest.xml} | 15 +- .../usb-controller-automatic-virt-aarch64.xml | 12 ++ ...-virt-loongarch64.loongarch64-latest.args} | 20 +-- ...c-virt-loongarch64.loongarch64-latest.xml} | 12 +- ...-controller-automatic-virt-loongarch64.xml | 12 ++ ...utomatic-virt-riscv64.riscv64-latest.args} | 20 +-- ...automatic-virt-riscv64.riscv64-latest.xml} | 11 +- ...usb-controller-automatic-virt-riscv64.xml} | 8 +- ...default-fallback-g3beige.ppc64-latest.args | 1 - ...-default-fallback-g3beige.ppc64-latest.xml | 11 +- ...r-default-fallback-mac99.ppc64-latest.args | 1 - ...er-default-fallback-mac99.ppc64-latest.xml | 11 +- ...-default-fallback-mac99ppc.ppc-latest.args | 1 - ...r-default-fallback-mac99ppc.ppc-latest.xml | 11 +- ...default-fallback-nousb.aarch64-latest.args | 32 ---- ...-default-fallback-nousb.aarch64-latest.xml | 23 --- .../usb-controller-default-fallback-nousb.xml | 1 - ...efault-fallback-powernv9.ppc64-latest.args | 1 - ...default-fallback-powernv9.ppc64-latest.xml | 11 +- ...ault-fallback-realview.aarch64-latest.args | 4 +- ...fault-fallback-realview.aarch64-latest.xml | 6 +- ...ck-versatilepb-aarch64.aarch64-latest.args | 32 ---- ...ack-versatilepb-aarch64.aarch64-latest.xml | 25 --- ...r-default-fallback-versatilepb-aarch64.xml | 1 - ...er-default-fallback-versatilepb-armv7l.xml | 1 - ...t-fallback-versatilepb.armv7l-latest.args} | 0 ...lt-fallback-versatilepb.armv7l-latest.xml} | 0 ...ontroller-default-fallback-versatilepb.xml | 1 + ...fallback-virt-aarch64.aarch64-latest.args} | 28 ++-- ...-fallback-virt-aarch64.aarch64-latest.xml} | 26 ++- ...ntroller-default-fallback-virt-aarch64.xml | 1 + ...fallback-virt-riscv64.riscv64-latest.args} | 28 ++-- ...-fallback-virt-riscv64.riscv64-latest.xml} | 26 +-- ...ntroller-default-fallback-virt-riscv64.xml | 1 + ...ntroller-default-g3beige.ppc64-latest.args | 1 - ...ontroller-default-g3beige.ppc64-latest.xml | 11 +- .../usb-controller-default-g3beige.xml | 11 +- ...ntroller-default-i440fx.x86_64-latest.args | 1 - ...ontroller-default-i440fx.x86_64-latest.xml | 4 +- .../usb-controller-default-i440fx.xml | 8 +- ...controller-default-isapc.x86_64-latest.err | 2 +- .../usb-controller-default-isapc.xml | 2 - ...controller-default-mac99.ppc64-latest.args | 1 - ...-controller-default-mac99.ppc64-latest.xml | 11 +- .../usb-controller-default-mac99.xml | 11 +- ...ontroller-default-mac99ppc.ppc-latest.args | 3 +- ...controller-default-mac99ppc.ppc-latest.xml | 13 +- .../usb-controller-default-mac99ppc.xml | 11 +- ...fault-nousb.aarch64-latest.abi-update.err} | 0 ...ntroller-default-nousb.aarch64-latest.args | 32 ---- ...ontroller-default-nousb.aarch64-latest.err | 1 + ...ontroller-default-nousb.aarch64-latest.xml | 23 --- .../usb-controller-default-nousb.xml | 1 - ...troller-default-powernv9.ppc64-latest.args | 1 - ...ntroller-default-powernv9.ppc64-latest.xml | 11 +- .../usb-controller-default-powernv9.xml | 11 +- ...fault-pseries.ppc64-latest.abi-update.args | 1 - ...efault-pseries.ppc64-latest.abi-update.xml | 11 +- ...ntroller-default-pseries.ppc64-latest.args | 1 - ...ontroller-default-pseries.ppc64-latest.xml | 11 +- .../usb-controller-default-pseries.xml | 18 +-- ...-controller-default-q35.x86_64-latest.args | 5 +- ...b-controller-default-q35.x86_64-latest.xml | 18 ++- .../usb-controller-default-q35.xml | 11 +- ...oller-default-realview.aarch64-latest.args | 4 +- ...roller-default-realview.aarch64-latest.xml | 6 +- .../usb-controller-default-realview.xml | 3 +- ...ontroller-default-s390x.s390x-latest.args} | 11 +- ...controller-default-s390x.s390x-latest.xml} | 16 +- .../usb-controller-default-s390x.xml | 14 ++ ...fault-unavailable-g3beige.ppc64-latest.xml | 34 ---- ...fault-unavailable-i440fx.x86_64-latest.xml | 31 ---- ...default-unavailable-mac99.ppc64-latest.xml | 34 ---- ...efault-unavailable-mac99ppc.ppc-latest.xml | 31 ---- ...ault-unavailable-nousb.aarch64-latest.args | 32 ---- ...fault-unavailable-nousb.aarch64-latest.xml | 23 --- ...b-controller-default-unavailable-nousb.xml | 1 - ...ault-unavailable-powernv9.ppc64-latest.xml | 34 ---- ...-default-unavailable-q35.x86_64-latest.xml | 33 ---- ...t-unavailable-realview.aarch64-latest.args | 31 ---- ...t-unavailable-realview.aarch64-latest.err} | 0 ...lt-unavailable-realview.aarch64-latest.xml | 23 --- ...le-versatilepb-aarch64.aarch64-latest.args | 32 ---- ...ble-versatilepb-aarch64.aarch64-latest.xml | 25 --- ...efault-unavailable-versatilepb-aarch64.xml | 1 - ...default-unavailable-versatilepb-armv7l.xml | 1 - ...unavailable-versatilepb.armv7l-latest.err} | 0 ...roller-default-unavailable-versatilepb.xml | 1 + ...available-virt-aarch64.aarch64-latest.err} | 0 ...oller-default-unavailable-virt-aarch64.xml | 1 + ...available-virt-riscv64.riscv64-latest.err} | 0 ...oller-default-unavailable-virt-riscv64.xml | 1 + ...lt-versatilepb-aarch64.aarch64-latest.args | 32 ---- ...controller-default-versatilepb-aarch64.xml | 16 -- ...fault-versatilepb-armv7l.armv7l-latest.xml | 27 ---- ...er-default-versatilepb.armv7l-latest.args} | 2 +- ...ler-default-versatilepb.armv7l-latest.xml} | 4 +- ...=> usb-controller-default-versatilepb.xml} | 1 - ...-default-virt-aarch64.aarch64-latest.args} | 26 ++- ...r-default-virt-aarch64.aarch64-latest.xml} | 24 ++- ...> usb-controller-default-virt-aarch64.xml} | 9 +- ...-virt-loongarch64.loongarch64-latest.args} | 26 ++- ...t-virt-loongarch64.loongarch64-latest.xml} | 21 +-- ...b-controller-default-virt-loongarch64.xml} | 9 +- ...-default-virt-riscv64.riscv64-latest.args} | 26 ++- ...r-default-virt-riscv64.riscv64-latest.xml} | 20 +-- ...> usb-controller-default-virt-riscv64.xml} | 8 +- ...troller-ich9-autoassign.x86_64-latest.args | 1 - ...ntroller-ich9-autoassign.x86_64-latest.xml | 4 +- .../usb-controller-ich9-autoassign.xml | 16 +- ...ntroller-ich9-companion.x86_64-latest.args | 1 - ...ontroller-ich9-companion.x86_64-latest.xml | 4 +- .../usb-controller-ich9-companion.xml | 4 +- ...ntroller-ich9-ehci-addr.x86_64-latest.args | 1 - ...ontroller-ich9-ehci-addr.x86_64-latest.xml | 4 +- .../usb-controller-ich9-ehci-addr.xml | 4 +- .../usb-controller-ich9-no-companion.xml | 6 +- ...er-nec-xhci-autoassign.x86_64-latest.args} | 0 ...ler-nec-xhci-autoassign.x86_64-latest.xml} | 0 ...=> usb-controller-nec-xhci-autoassign.xml} | 14 +- .../usb-controller-nec-xhci-limit.xml | 2 - .../usb-controller-nec-xhci.x86_64-latest.xml | 2 +- .../usb-controller-nec-xhci.xml | 7 - .../usb-controller-piix3.x86_64-latest.args | 1 - .../usb-controller-piix3.x86_64-latest.xml | 4 +- .../qemuxmlconfdata/usb-controller-piix3.xml | 4 +- tests/qemuxmlconftest.c | 128 ++++++++++----- 206 files changed, 897 insertions(+), 1601 deletions(-) delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.args delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.xml delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.err copy tests/qemuxmlconfdata/{usb-controller-default-isapc.xml => isapc-pci.xml} (64%) rename tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.x86_64-latest.args => usb-controller-automatic-i440fx.x86_64-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.x86_64-latest.xml => usb-controller-automatic-i440fx.x86_64-latest.xml} (100%) copy tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.xml => usb-controller-automatic-i440fx.xml} (83%) copy tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.args => usb-controller-automatic-isapc.x86_64-latest.args} (100%) copy tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.xml => usb-controller-automatic-isapc.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-isapc.xml => usb-controller-automatic-isapc.xml} (83%) copy tests/qemuxmlconfdata/{usb-controller-default-pseries.ppc64-latest.abi-update.args => usb-controller-automatic-pseries.ppc64-latest.abi-update.args} (93%) rename tests/qemuxmlconfdata/{usb-controller-default-unavailable-pseries.ppc64-latest.xml => usb-controller-automatic-pseries.ppc64-latest.abi-update.xml} (77%) copy tests/qemuxmlconfdata/{usb-controller-default-pseries.ppc64-latest.args => usb-controller-automatic-pseries.ppc64-latest.args} (93%) copy tests/qemuxmlconfdata/{usb-controller-default-pseries.ppc64-latest.xml => usb-controller-automatic-pseries.ppc64-latest.xml} (80%) copy tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.xml => usb-controller-automatic-pseries.xml} (50%) copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.args => usb-controller-automatic-q35.x86_64-latest.args} (100%) copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.xml => usb-controller-automatic-q35.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-q35.xml => usb-controller-automatic-q35.xml} (83%) copy tests/qemuxmlconfdata/{aarch64-realview-minimal.aarch64-latest.abi-update.args => usb-controller-automatic-realview.aarch64-latest.args} (89%) rename tests/qemuxmlconfdata/{usb-controller-default-versatilepb-aarch64.aarch64-latest.xml => usb-controller-automatic-realview.aarch64-latest.xml} (93%) rename tests/qemuxmlconfdata/{aarch64-versatilepb-minimal.xml => usb-controller-automatic-realview.xml} (85%) copy tests/qemuxmlconfdata/{ppc-mac99-minimal.ppc-latest.abi-update.args => usb-controller-automatic-s390x.s390x-latest.args} (70%) copy tests/qemuxmlconfdata/{s390-usb-address.s390x-latest.xml => usb-controller-automatic-s390x.s390x-latest.xml} (59%) create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-s390x.xml copy tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.err} (100%) copy tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-automatic-unavailable-pseries.ppc64-latest.err} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.xml copy tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-automatic-unavailable-realview.aarch64-latest.err} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.xml copy tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.xml rename tests/qemuxmlconfdata/{usb-controller-default-versatilepb-armv7l.armv7l-latest.args => usb-controller-automatic-versatilepb.armv7l-latest.args} (94%) rename tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.xml => usb-controller-automatic-versatilepb.armv7l-latest.xml} (93%) copy tests/qemuxmlconfdata/{armv7l-versatilepb-minimal.xml => usb-controller-automatic-versatilepb.xml} (100%) copy tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.args => usb-controller-automatic-virt-aarch64.aarch64-latest.args} (52%) copy tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.xml => usb-controller-automatic-virt-aarch64.aarch64-latest.xml} (63%) create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.xml copy tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.args => usb-controller-automatic-virt-loongarch64.loongarch64-latest.args} (52%) copy tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.xml => usb-controller-automatic-virt-loongarch64.loongarch64-latest.xml} (63%) create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.xml rename tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.args => usb-controller-automatic-virt-riscv64.riscv64-latest.args} (52%) rename tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.xml => usb-controller-automatic-virt-riscv64.riscv64-latest.xml} (67%) rename tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.xml => usb-controller-automatic-virt-riscv64.xml} (53%) delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.xml rename tests/qemuxmlconfdata/{usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args => usb-controller-default-fallback-versatilepb.armv7l-latest.args} (100%) copy tests/qemuxmlconfdata/{armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml => usb-controller-default-fallback-versatilepb.armv7l-latest.xml} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.xml copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.args => usb-controller-default-fallback-virt-aarch64.aarch64-latest.args} (50%) copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.xml => usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml} (60%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.xml copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.args => usb-controller-default-fallback-virt-riscv64.riscv64-latest.args} (50%) rename tests/qemuxmlconfdata/{usb-controller-nec-xhci-unavailable.x86_64-latest.xml => usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml} (53%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml copy tests/qemuxmlconfdata/{usb-controller-default-isapc.x86_64-latest.err => usb-controller-default-nousb.aarch64-latest.abi-update.err} (100%) delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml copy tests/qemuxmlconfdata/{ppc-mac99-minimal.ppc-latest.abi-update.args => usb-controller-default-s390x.s390x-latest.args} (70%) copy tests/qemuxmlconfdata/{s390-usb-address.s390x-latest.xml => usb-controller-default-s390x.s390x-latest.xml} (59%) create mode 100644 tests/qemuxmlconfdata/usb-controller-default-s390x.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.args copy tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-default-unavailable-realview.aarch64-latest.err} (100%) delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.xml copy tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-default-unavailable-versatilepb.armv7l-latest.err} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.xml copy tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-default-unavailable-virt-aarch64.aarch64-latest.err} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.xml rename tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-default-unavailable-virt-riscv64.riscv64-latest.err} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.armv7l-latest.xml copy tests/qemuxmlconfdata/{armv7l-versatilepb-minimal.armv7l-latest.abi-update.args => usb-controller-default-versatilepb.armv7l-latest.args} (94%) rename tests/qemuxmlconfdata/{usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml => usb-controller-default-versatilepb.armv7l-latest.xml} (93%) rename tests/qemuxmlconfdata/{usb-controller-default-versatilepb-armv7l.xml => usb-controller-default-versatilepb.xml} (87%) copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.args => usb-controller-default-virt-aarch64.aarch64-latest.args} (55%) copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.xml => usb-controller-default-virt-aarch64.aarch64-latest.xml} (63%) copy tests/qemuxmlconfdata/{usb-controller-default-isapc.xml => usb-controller-default-virt-aarch64.xml} (50%) copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.args => usb-controller-default-virt-loongarch64.loongarch64-latest.args} (55%) copy tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.xml => usb-controller-default-virt-loongarch64.loongarch64-latest.xml} (63%) copy tests/qemuxmlconfdata/{usb-controller-default-isapc.xml => usb-controller-default-virt-loongarch64.xml} (50%) rename tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.args => usb-controller-default-virt-riscv64.riscv64-latest.args} (55%) rename tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.xml => usb-controller-default-virt-riscv64.riscv64-latest.xml} (65%) copy tests/qemuxmlconfdata/{usb-controller-default-isapc.xml => usb-controller-default-virt-riscv64.xml} (57%) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.x86_64-latest.args => usb-controller-nec-xhci-autoassign.x86_64-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.x86_64-latest.xml => usb-controller-nec-xhci-autoassign.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.xml => usb-controller-nec-xhci-autoassign.xml} (64%) -- 2.50.1

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...gs => usb-controller-nec-xhci-autoassign.x86_64-latest.args} | 0 ...xml => usb-controller-nec-xhci-autoassign.x86_64-latest.xml} | 0 ...ci-autoassign.xml => usb-controller-nec-xhci-autoassign.xml} | 0 tests/qemuxmlconftest.c | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.x86_64-latest.args => usb-controller-nec-xhci-autoassign.x86_64-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.x86_64-latest.xml => usb-controller-nec-xhci-autoassign.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.xml => usb-controller-nec-xhci-autoassign.xml} (100%) diff --git a/tests/qemuxmlconfdata/usb-controller-nex-xhci-autoassign.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.x86_64-latest.args similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-nex-xhci-autoassign.x86_64-latest.args rename to tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.x86_64-latest.args diff --git a/tests/qemuxmlconfdata/usb-controller-nex-xhci-autoassign.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.x86_64-latest.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-nex-xhci-autoassign.x86_64-latest.xml rename to tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.x86_64-latest.xml diff --git a/tests/qemuxmlconfdata/usb-controller-nex-xhci-autoassign.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-nex-xhci-autoassign.xml rename to tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.xml diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 079f20ddf4..802f90ec43 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2089,7 +2089,7 @@ mymain(void) ARG_FLAGS, FLAG_EXPECT_FAILURE, ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, ARG_END); - DO_TEST_CAPS_LATEST("usb-controller-nex-xhci-autoassign"); + DO_TEST_CAPS_LATEST("usb-controller-nec-xhci-autoassign"); DO_TEST_CAPS_LATEST_PARSE_ERROR("usb-controller-nec-xhci-limit"); DO_TEST_CAPS_LATEST("usb-controller-qemu-xhci"); DO_TEST_CAPS_LATEST_PARSE_ERROR("usb-controller-qemu-xhci-limit"); -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:05 +0200, Andrea Bolognani via Devel wrote:
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...gs => usb-controller-nec-xhci-autoassign.x86_64-latest.args} | 0 ...xml => usb-controller-nec-xhci-autoassign.x86_64-latest.xml} | 0 ...ci-autoassign.xml => usb-controller-nec-xhci-autoassign.xml} | 0 tests/qemuxmlconftest.c | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.x86_64-latest.args => usb-controller-nec-xhci-autoassign.x86_64-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.x86_64-latest.xml => usb-controller-nec-xhci-autoassign.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-nex-xhci-autoassign.xml => usb-controller-nec-xhci-autoassign.xml} (100%)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

We already test the machine type on armv7l and realview on aarch64, so these handful of test cases can be dropped without negatively impacting our coverage. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...epb-minimal.aarch64-latest.abi-update.args | 32 ------------------- ...lepb-minimal.aarch64-latest.abi-update.xml | 25 --------------- ...64-versatilepb-minimal.aarch64-latest.args | 32 ------------------- ...h64-versatilepb-minimal.aarch64-latest.xml | 25 --------------- .../aarch64-versatilepb-minimal.xml | 14 -------- ...ck-versatilepb-aarch64.aarch64-latest.args | 32 ------------------- ...ack-versatilepb-aarch64.aarch64-latest.xml | 25 --------------- ...r-default-fallback-versatilepb-aarch64.xml | 1 - ...er-default-fallback-versatilepb-armv7l.xml | 1 - ...t-fallback-versatilepb.armv7l-latest.args} | 0 ...lt-fallback-versatilepb.armv7l-latest.xml} | 0 ...ontroller-default-fallback-versatilepb.xml | 1 + ...le-versatilepb-aarch64.aarch64-latest.args | 32 ------------------- ...ble-versatilepb-aarch64.aarch64-latest.xml | 25 --------------- ...efault-unavailable-versatilepb-aarch64.xml | 1 - ...default-unavailable-versatilepb-armv7l.xml | 1 - ...unavailable-versatilepb.armv7l-latest.err} | 0 ...unavailable-versatilepb.armv7l-latest.xml} | 0 ...roller-default-unavailable-versatilepb.xml | 1 + ...lt-versatilepb-aarch64.aarch64-latest.args | 32 ------------------- ...ult-versatilepb-aarch64.aarch64-latest.xml | 25 --------------- ...controller-default-versatilepb-aarch64.xml | 16 ---------- ...er-default-versatilepb.armv7l-latest.args} | 0 ...ler-default-versatilepb.armv7l-latest.xml} | 0 ...=> usb-controller-default-versatilepb.xml} | 0 tests/qemuxmlconftest.c | 20 ++---------- 26 files changed, 5 insertions(+), 336 deletions(-) delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.args delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.xml delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.xml delete mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.xml rename tests/qemuxmlconfdata/{usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args => usb-controller-default-fallback-versatilepb.armv7l-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml => usb-controller-default-fallback-versatilepb.armv7l-latest.xml} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.xml rename tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err => usb-controller-default-unavailable-versatilepb.armv7l-latest.err} (100%) rename tests/qemuxmlconfdata/{usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.xml => usb-controller-default-unavailable-versatilepb.armv7l-latest.xml} (100%) create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.xml rename tests/qemuxmlconfdata/{usb-controller-default-versatilepb-armv7l.armv7l-latest.args => usb-controller-default-versatilepb.armv7l-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-default-versatilepb-armv7l.armv7l-latest.xml => usb-controller-default-versatilepb.armv7l-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-default-versatilepb-armv7l.xml => usb-controller-default-versatilepb.xml} (100%) diff --git a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.args b/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.args deleted file mode 100644 index 2f45355a5d..0000000000 --- a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine versatilepb,usb=off,dump-guest-core=off,memory-backend=versatile.ram \ --accel kvm \ --cpu host \ --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 \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.xml deleted file mode 100644 index fddf8fd3a7..0000000000 --- a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.xml +++ /dev/null @@ -1,25 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='versatilepb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.args deleted file mode 100644 index 2f45355a5d..0000000000 --- a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine versatilepb,usb=off,dump-guest-core=off,memory-backend=versatile.ram \ --accel kvm \ --cpu host \ --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 \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.xml deleted file mode 100644 index fddf8fd3a7..0000000000 --- a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.xml +++ /dev/null @@ -1,25 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='versatilepb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.xml b/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.xml deleted file mode 100644 index 175e1f7e08..0000000000 --- a/tests/qemuxmlconfdata/aarch64-versatilepb-minimal.xml +++ /dev/null @@ -1,14 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='versatilepb'>hvm</type> - </os> - <cpu mode='host-passthrough'/> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.args deleted file mode 100644 index 2a82a246e8..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine versatilepb,usb=off,dump-guest-core=off,memory-backend=versatile.ram \ --accel kvm \ --cpu host \ --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 \ --device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ --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-fallback-versatilepb-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.xml deleted file mode 100644 index afac2f217f..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.xml +++ /dev/null @@ -1,25 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='versatilepb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.xml deleted file mode 120000 index f880b19c99..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.xml +++ /dev/null @@ -1 +0,0 @@ -usb-controller-default-versatilepb-aarch64.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.xml deleted file mode 120000 index 283956fe0b..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.xml +++ /dev/null @@ -1 +0,0 @@ -usb-controller-default-versatilepb-armv7l.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.args similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args rename to tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.args diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml rename to tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.xml diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.xml new file mode 120000 index 0000000000..7847b307fe --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.xml @@ -0,0 +1 @@ +usb-controller-default-versatilepb.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.args deleted file mode 100644 index 2a82a246e8..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine versatilepb,usb=off,dump-guest-core=off,memory-backend=versatile.ram \ --accel kvm \ --cpu host \ --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 \ --device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ --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-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.xml deleted file mode 100644 index afac2f217f..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.xml +++ /dev/null @@ -1,25 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='versatilepb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.xml deleted file mode 120000 index f880b19c99..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.xml +++ /dev/null @@ -1 +0,0 @@ -usb-controller-default-versatilepb-aarch64.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.xml deleted file mode 120000 index 283956fe0b..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.xml +++ /dev/null @@ -1 +0,0 @@ -usb-controller-default-versatilepb-armv7l.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.err similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err rename to tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.err diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.xml rename to tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.xml new file mode 120000 index 0000000000..7847b307fe --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.xml @@ -0,0 +1 @@ +usb-controller-default-versatilepb.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.args deleted file mode 100644 index 2a82a246e8..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine versatilepb,usb=off,dump-guest-core=off,memory-backend=versatile.ram \ --accel kvm \ --cpu host \ --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 \ --device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ --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-versatilepb-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.xml deleted file mode 100644 index afac2f217f..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.xml +++ /dev/null @@ -1,25 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='versatilepb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.xml deleted file mode 100644 index fac54753a3..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.xml +++ /dev/null @@ -1,16 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='versatilepb'>hvm</type> - </os> - <cpu mode='host-passthrough'/> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> - <controller type='usb' index='0'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.armv7l-latest.args rename to tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.armv7l-latest.xml rename to tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.xml rename to tests/qemuxmlconfdata/usb-controller-default-versatilepb.xml diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 802f90ec43..e9993bc8a0 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1254,8 +1254,6 @@ mymain(void) DO_TEST_CAPS_LATEST_ABI_UPDATE("x86_64-q35-minimal"); DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-minimal", "aarch64"); DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("aarch64-virt-minimal", "aarch64"); - DO_TEST_CAPS_ARCH_LATEST("aarch64-versatilepb-minimal", "aarch64"); - DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("aarch64-versatilepb-minimal", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("armv7l-versatilepb-minimal", "armv7l"); DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("armv7l-versatilepb-minimal", "armv7l"); DO_TEST_CAPS_ARCH_LATEST("aarch64-realview-minimal", "aarch64"); @@ -1976,25 +1974,13 @@ mymain(void) ARG_END); /* controller selection tests for various uncommon machine types */ - DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-versatilepb-aarch64", "aarch64"); - DO_TEST_FULL("usb-controller-default-fallback-versatilepb-aarch64", ".aarch64-latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, - ARG_END); - DO_TEST_FULL("usb-controller-default-unavailable-versatilepb-aarch64", ".aarch64-latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, - ARG_END); - - DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-versatilepb-armv7l", "armv7l"); - DO_TEST_FULL("usb-controller-default-fallback-versatilepb-armv7l", ".armv7l-latest", + DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-versatilepb", "armv7l"); + DO_TEST_FULL("usb-controller-default-fallback-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, ARG_END); - DO_TEST_FULL("usb-controller-default-unavailable-versatilepb-armv7l", ".armv7l-latest", + DO_TEST_FULL("usb-controller-default-unavailable-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_FAILURE, -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:06 +0200, Andrea Bolognani via Devel wrote:
We already test the machine type on armv7l and realview on aarch64, so these handful of test cases can be dropped without negatively impacting our coverage.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

It's redundant (these machine types don't get a memballoon added automatically anyway), plus the test is supposed to show what happens when a minimal configuration is fed to libvirt and including additional elements goes against that. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../aarch64-nousb-minimal.aarch64-latest.abi-update.xml | 1 - tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.xml | 1 - tests/qemuxmlconfdata/aarch64-nousb-minimal.xml | 1 - .../aarch64-realview-minimal.aarch64-latest.abi-update.xml | 1 - .../qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml | 1 - tests/qemuxmlconfdata/aarch64-realview-minimal.xml | 1 - .../armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml | 1 - .../qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml | 1 - tests/qemuxmlconfdata/armv7l-versatilepb-minimal.xml | 1 - 9 files changed, 9 deletions(-) diff --git a/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.abi-update.xml index e3f04fbbff..b12ef03d4b 100644 --- a/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.abi-update.xml @@ -16,6 +16,5 @@ <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> <audio id='1' type='none'/> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.xml index e3f04fbbff..b12ef03d4b 100644 --- a/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.xml @@ -16,6 +16,5 @@ <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> <audio id='1' type='none'/> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/aarch64-nousb-minimal.xml b/tests/qemuxmlconfdata/aarch64-nousb-minimal.xml index 6505122cb8..7076f5ac78 100644 --- a/tests/qemuxmlconfdata/aarch64-nousb-minimal.xml +++ b/tests/qemuxmlconfdata/aarch64-nousb-minimal.xml @@ -10,6 +10,5 @@ <cpu mode='host-passthrough'/> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml index 372d5bda6a..de44852e4e 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml @@ -17,6 +17,5 @@ <emulator>/usr/bin/qemu-system-aarch64</emulator> <controller type='usb' index='0' model='pci-ohci'/> <audio id='1' type='none'/> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml index 372d5bda6a..de44852e4e 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml @@ -17,6 +17,5 @@ <emulator>/usr/bin/qemu-system-aarch64</emulator> <controller type='usb' index='0' model='pci-ohci'/> <audio id='1' type='none'/> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.xml index b58b207299..2502e5d795 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.xml @@ -9,6 +9,5 @@ <cpu mode='host-passthrough'/> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml index 482029e3b0..7b21b24927 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml @@ -22,6 +22,5 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml index 482029e3b0..7b21b24927 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml @@ -22,6 +22,5 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.xml index 77cd254048..5034076382 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.xml @@ -8,6 +8,5 @@ </os> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <memballoon model='none'/> </devices> </domain> -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:07 +0200, Andrea Bolognani via Devel wrote:
It's redundant (these machine types don't get a memballoon added automatically anyway), plus the test is supposed to show what happens when a minimal configuration is fed to libvirt and including additional elements goes against that.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

We want to ensure that libvirt will automatically allocate the PCI address, and setting it ourselves ahead of time will prevent that from happening. In the case of q35, this change will cause additional PCI controllers to show up. That's desirable, as it demonstrates the behavior libvirt users will actually see. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../usb-controller-default-i440fx.xml | 4 +--- .../usb-controller-default-pseries.xml | 4 +--- ...usb-controller-default-q35.x86_64-latest.args | 5 ++++- .../usb-controller-default-q35.x86_64-latest.xml | 16 +++++++++++++++- .../usb-controller-default-q35.xml | 4 +--- ...ler-default-unavailable-q35.x86_64-latest.xml | 16 +++++++++++++++- 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml b/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml index 81149b73be..3987b78ebc 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml @@ -10,9 +10,7 @@ </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> + <controller type='usb' index='0'/> <memballoon model='virtio'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-pseries.xml b/tests/qemuxmlconfdata/usb-controller-default-pseries.xml index 3717c58261..676a578eb0 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-pseries.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-pseries.xml @@ -18,9 +18,7 @@ <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> + <controller type='usb' index='0'/> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </memballoon> diff --git a/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.args index 23bdedef6c..7ba7b39a87 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.args @@ -26,7 +26,10 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pcie.0","addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -global ICH9-LPC.noreboot=off \ -watchdog-action reset \ diff --git a/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml index fa67c860bb..4295586490 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml @@ -18,8 +18,22 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-q35.xml b/tests/qemuxmlconfdata/usb-controller-default-q35.xml index 1436495902..b3a57365bc 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-q35.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-q35.xml @@ -15,9 +15,7 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> + <controller type='usb' index='0'/> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml index c857816a3e..f5561ebc1a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml @@ -18,8 +18,22 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:08 +0200, Andrea Bolognani via Devel wrote:
We want to ensure that libvirt will automatically allocate the PCI address, and setting it ourselves ahead of time will prevent that from happening.
In the case of q35, this change will cause additional PCI controllers to show up. That's desirable, as it demonstrates the behavior libvirt users will actually see.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../usb-controller-default-i440fx.xml | 4 +--- .../usb-controller-default-pseries.xml | 4 +--- ...usb-controller-default-q35.x86_64-latest.args | 5 ++++- .../usb-controller-default-q35.x86_64-latest.xml | 16 +++++++++++++++- .../usb-controller-default-q35.xml | 4 +--- ...ler-default-unavailable-q35.x86_64-latest.xml | 16 +++++++++++++++- 6 files changed, 37 insertions(+), 12 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

These tests are all about USB controllers and anything else is a distraction that we can happily live without. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...r-automatic-unavailable-q35.x86_64-latest.xml | 2 +- .../usb-controller-automatic-unavailable-q35.xml | 7 ------- ...er-default-fallback-g3beige.ppc64-latest.args | 1 - ...ler-default-fallback-g3beige.ppc64-latest.xml | 11 ++--------- ...ller-default-fallback-mac99.ppc64-latest.args | 1 - ...oller-default-fallback-mac99.ppc64-latest.xml | 11 ++--------- ...ler-default-fallback-mac99ppc.ppc-latest.args | 1 - ...ller-default-fallback-mac99ppc.ppc-latest.xml | 11 ++--------- ...ler-default-fallback-nousb.aarch64-latest.xml | 1 - ...r-default-fallback-powernv9.ppc64-latest.args | 1 - ...er-default-fallback-powernv9.ppc64-latest.xml | 11 ++--------- ...-default-fallback-realview.aarch64-latest.xml | 1 - ...efault-fallback-versatilepb.armv7l-latest.xml | 2 +- ...-controller-default-g3beige.ppc64-latest.args | 1 - ...b-controller-default-g3beige.ppc64-latest.xml | 11 ++--------- .../usb-controller-default-g3beige.xml | 11 +---------- ...-controller-default-i440fx.x86_64-latest.args | 1 - ...b-controller-default-i440fx.x86_64-latest.xml | 4 +--- .../usb-controller-default-i440fx.xml | 4 +--- .../usb-controller-default-isapc.xml | 2 -- ...sb-controller-default-mac99.ppc64-latest.args | 1 - ...usb-controller-default-mac99.ppc64-latest.xml | 11 ++--------- .../usb-controller-default-mac99.xml | 11 +---------- ...b-controller-default-mac99ppc.ppc-latest.args | 1 - ...sb-controller-default-mac99ppc.ppc-latest.xml | 11 ++--------- .../usb-controller-default-mac99ppc.xml | 11 +---------- ...b-controller-default-nousb.aarch64-latest.xml | 1 - .../usb-controller-default-nousb.xml | 1 - ...controller-default-powernv9.ppc64-latest.args | 1 - ...-controller-default-powernv9.ppc64-latest.xml | 11 ++--------- .../usb-controller-default-powernv9.xml | 11 +---------- ...-default-pseries.ppc64-latest.abi-update.args | 1 - ...r-default-pseries.ppc64-latest.abi-update.xml | 11 ++--------- ...-controller-default-pseries.ppc64-latest.args | 1 - ...b-controller-default-pseries.ppc64-latest.xml | 11 ++--------- .../usb-controller-default-pseries.xml | 14 +------------- .../usb-controller-default-q35.x86_64-latest.xml | 12 ++++++------ .../usb-controller-default-q35.xml | 7 ------- ...ontroller-default-realview.aarch64-latest.xml | 1 - .../usb-controller-default-realview.xml | 1 - ...-default-unavailable-g3beige.ppc64-latest.xml | 11 ++--------- ...-default-unavailable-i440fx.x86_64-latest.xml | 4 +--- ...er-default-unavailable-mac99.ppc64-latest.xml | 11 ++--------- ...r-default-unavailable-mac99ppc.ppc-latest.xml | 11 ++--------- ...-default-unavailable-nousb.aarch64-latest.xml | 1 - ...default-unavailable-powernv9.ppc64-latest.xml | 11 ++--------- ...-default-unavailable-pseries.ppc64-latest.xml | 11 ++--------- ...ler-default-unavailable-q35.x86_64-latest.xml | 12 ++++++------ ...fault-unavailable-realview.aarch64-latest.xml | 1 - ...ult-unavailable-versatilepb.armv7l-latest.xml | 2 +- ...troller-default-versatilepb.armv7l-latest.xml | 2 +- .../usb-controller-default-versatilepb.xml | 1 - ...controller-ich9-autoassign.x86_64-latest.args | 1 - ...-controller-ich9-autoassign.x86_64-latest.xml | 4 +--- .../usb-controller-ich9-autoassign.xml | 16 +++++----------- ...-controller-ich9-companion.x86_64-latest.args | 1 - ...b-controller-ich9-companion.x86_64-latest.xml | 4 +--- .../usb-controller-ich9-companion.xml | 4 +--- ...-controller-ich9-ehci-addr.x86_64-latest.args | 1 - ...b-controller-ich9-ehci-addr.x86_64-latest.xml | 4 +--- .../usb-controller-ich9-ehci-addr.xml | 4 +--- .../usb-controller-ich9-no-companion.xml | 6 +----- .../usb-controller-implicit-i440fx.xml | 2 -- .../usb-controller-implicit-isapc.xml | 2 -- .../usb-controller-implicit-q35.xml | 2 -- .../usb-controller-nec-xhci-autoassign.xml | 14 ++++---------- .../usb-controller-nec-xhci-limit.xml | 2 -- ...roller-nec-xhci-unavailable.x86_64-latest.xml | 2 +- .../usb-controller-nec-xhci.x86_64-latest.xml | 2 +- .../qemuxmlconfdata/usb-controller-nec-xhci.xml | 7 ------- .../usb-controller-piix3.x86_64-latest.args | 1 - .../usb-controller-piix3.x86_64-latest.xml | 4 +--- tests/qemuxmlconfdata/usb-controller-piix3.xml | 4 +--- 73 files changed, 73 insertions(+), 317 deletions(-) diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.xml index 11ca806c63..d6e40f437e 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.xml @@ -17,10 +17,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='pci' index='0' model='pcie-root'/> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.xml index d89dc4afe8..d3ceefe2f1 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.xml @@ -2,19 +2,12 @@ <name>q35-test</name> <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='q35'>hvm</type> - <boot dev='hd'/> </os> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='pci' index='0' model='pcie-root'/> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.args index 11c3b54f08..7b0fd85a77 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-fallback-g3beige.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.xml index 93672e3d6b..655687b27a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='g3beige'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>g3</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.args index 79964a4d10..ba81f4e2ad 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-fallback-mac99.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.xml index f510b2c713..1237fe1281 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='mac99'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>ppc64</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args index c89656699a..da5437bc24 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args @@ -27,6 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-fallback-mac99ppc.ppc-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml index 7e74642ba5..2fbca012c9 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml @@ -8,15 +8,10 @@ <type arch='ppc' machine='mac99'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -24,8 +19,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml index a01dd15168..fa258c5671 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml @@ -15,7 +15,6 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='qemu-xhci'/> <audio id='1' type='none'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.args index c4b6238347..71528dee24 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-fallback-powernv9.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.xml index b8e2c77dca..4bbf78199f 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='powernv9'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>POWER9</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml index d875deea19..f37501b769 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml @@ -15,7 +15,6 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='qemu-xhci'/> <audio id='1' type='none'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.xml index d934c3e842..482029e3b0 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb.armv7l-latest.xml @@ -17,10 +17,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.args index 11c3b54f08..7b0fd85a77 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-g3beige.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.xml index 93672e3d6b..655687b27a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='g3beige'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>g3</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-g3beige.xml b/tests/qemuxmlconfdata/usb-controller-default-g3beige.xml index 6ff8b78312..83bd3f38de 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-g3beige.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-g3beige.xml @@ -2,22 +2,13 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='ppc64' machine='g3beige'>hvm</type> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-i440fx.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-i440fx.x86_64-latest.args index b2d71ccb60..e4be4266bb 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-i440fx.x86_64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-i440fx.x86_64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -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-i440fx.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-i440fx.x86_64-latest.xml index c74353b056..89631180ac 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-i440fx.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-i440fx.x86_64-latest.xml @@ -24,8 +24,6 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml b/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml index 3987b78ebc..2db9c16c48 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-i440fx.xml @@ -2,15 +2,13 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0'/> - <memballoon model='virtio'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-isapc.xml b/tests/qemuxmlconfdata/usb-controller-default-isapc.xml index fa87acbdff..195a59001e 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-isapc.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-isapc.xml @@ -2,11 +2,9 @@ <name>q35-test</name> <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='isapc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> diff --git a/tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.args index 79964a4d10..ba81f4e2ad 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-mac99.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.xml index f510b2c713..1237fe1281 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='mac99'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>ppc64</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-mac99.xml b/tests/qemuxmlconfdata/usb-controller-default-mac99.xml index ad1b4a8588..f41aa2e219 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99.xml @@ -2,22 +2,13 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='ppc64' machine='mac99'>hvm</type> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args index 1adccc8af8..dcb2b49a53 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args @@ -27,6 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-mac99ppc.ppc-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.xml index 07efea9255..02cd54d7f7 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.xml @@ -8,15 +8,10 @@ <type arch='ppc' machine='mac99'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> <controller type='usb' index='0' model='piix3-uhci'> @@ -24,8 +19,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.xml b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.xml index 5f6fcebded..6f1c1a89ce 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.xml @@ -2,22 +2,13 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='ppc' machine='mac99'>hvm</type> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> <controller type='usb' index='0'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml index a01dd15168..fa258c5671 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml @@ -15,7 +15,6 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='qemu-xhci'/> <audio id='1' type='none'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-nousb.xml b/tests/qemuxmlconfdata/usb-controller-default-nousb.xml index 83a405800f..5647f93e4a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-nousb.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.xml @@ -10,7 +10,6 @@ <cpu mode='host-passthrough'/> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.args index c4b6238347..71528dee24 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-powernv9.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.xml index b8e2c77dca..4bbf78199f 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='powernv9'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>POWER9</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-powernv9.xml b/tests/qemuxmlconfdata/usb-controller-default-powernv9.xml index 62dc30c388..5ddf5892af 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-powernv9.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-powernv9.xml @@ -2,22 +2,13 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='ppc64' machine='powernv9'>hvm</type> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.args b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.args index 8ee4723b5a..3d8df5ff6f 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.args +++ b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"qemu-xhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x6"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.xml b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.xml index a1509b73e3..1c11a18b28 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.abi-update.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='pseries'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>POWER10</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='qemu-xhci'> @@ -30,9 +25,7 @@ <target index='0'/> </controller> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> - </memballoon> + <memballoon model='none'/> <panic model='pseries'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.args index e996fc73b8..1859e1f5f9 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x6"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.xml index 316a030af8..e92535a1f9 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-pseries.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='pseries'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>POWER10</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0' model='pci-ohci'> @@ -30,9 +25,7 @@ <target index='0'/> </controller> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> - </memballoon> + <memballoon model='none'/> <panic model='pseries'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-pseries.xml b/tests/qemuxmlconfdata/usb-controller-default-pseries.xml index 676a578eb0..7c57e37adf 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-pseries.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-pseries.xml @@ -2,25 +2,13 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='ppc64' machine='pseries'>hvm</type> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml index 4295586490..9418107fe4 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml @@ -17,6 +17,12 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> @@ -32,12 +38,6 @@ <target chassis='3' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-q35.xml b/tests/qemuxmlconfdata/usb-controller-default-q35.xml index b3a57365bc..ad6d7cbe47 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-q35.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-q35.xml @@ -2,19 +2,12 @@ <name>q35-test</name> <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='q35'>hvm</type> - <boot dev='hd'/> </os> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='pci' index='0' model='pcie-root'/> <controller type='usb' index='0'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml index d875deea19..f37501b769 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml @@ -15,7 +15,6 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='qemu-xhci'/> <audio id='1' type='none'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-realview.xml b/tests/qemuxmlconfdata/usb-controller-default-realview.xml index 2ff9d61308..8068d29515 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-realview.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-realview.xml @@ -9,7 +9,6 @@ <cpu mode='host-passthrough'/> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml index e977af05ee..409aeffe87 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='g3beige'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>g3</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml index 183cfe3b9a..b2847caee7 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml @@ -24,8 +24,6 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml index 45e5ef9890..4ee8c59607 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='mac99'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>ppc64</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml index 3899a4ecb1..22ec793ffa 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml @@ -8,15 +8,10 @@ <type arch='ppc' machine='mac99'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> <controller type='usb' index='0'> @@ -24,8 +19,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml index a01dd15168..fa258c5671 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml @@ -15,7 +15,6 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='qemu-xhci'/> <audio id='1' type='none'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml index d25eb9b376..c27af33c06 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='powernv9'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>POWER9</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'> @@ -27,8 +22,6 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml index 0813a9fba1..2b71e447e8 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml @@ -8,18 +8,13 @@ <type arch='ppc64' machine='pseries'>hvm</type> <boot dev='hd'/> </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>POWER10</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> + <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='usb' index='0'> @@ -30,9 +25,7 @@ <target index='0'/> </controller> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> - </memballoon> + <memballoon model='none'/> <panic model='pseries'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml index f5561ebc1a..e46489882a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml @@ -17,6 +17,12 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> @@ -32,12 +38,6 @@ <target chassis='3' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml index d875deea19..f37501b769 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml @@ -15,7 +15,6 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='qemu-xhci'/> <audio id='1' type='none'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml index ebea79c6d0..93bf8dcd0a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml @@ -17,10 +17,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml index dc1b37d626..e1a607c256 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml @@ -17,10 +17,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0' model='piix3-uhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.xml index b496f2f9f0..e74d62c46b 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.xml @@ -8,7 +8,6 @@ </os> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='pci' index='0' model='pci-root'/> <controller type='usb' index='0'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.x86_64-latest.args index 59d8430a40..4a8ed73ef3 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.x86_64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.x86_64-latest.args @@ -36,6 +36,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"usb-mouse","id":"input1","bus":"usb.0","port":"4"}' \ -device '{"driver":"usb-mouse","id":"input2","bus":"usb.0","port":"5"}' \ -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-ich9-autoassign.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.x86_64-latest.xml index 27038cfab8..48023e5c37 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.x86_64-latest.xml @@ -41,8 +41,6 @@ <audio id='1' type='none'/> <hub type='usb'/> <hub type='usb'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.xml b/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.xml index eb670dce8b..d0aa93d744 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.xml +++ b/tests/qemuxmlconfdata/usb-controller-ich9-autoassign.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> @@ -26,14 +24,10 @@ <address type='pci' domain='0' bus='0' slot='4' function='2'/> </controller> <hub type='usb'/> - <input type='mouse' bus='usb'> - </input> - <hub type='usb'> - </hub> - <input type='mouse' bus='usb'> - </input> - <input type='mouse' bus='usb'> - </input> - <memballoon model='virtio'/> + <input type='mouse' bus='usb'/> + <hub type='usb'/> + <input type='mouse' bus='usb'/> + <input type='mouse' bus='usb'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-companion.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-ich9-companion.x86_64-latest.args index b935a43647..4225a3489c 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-companion.x86_64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-ich9-companion.x86_64-latest.args @@ -31,6 +31,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"ich9-usb-uhci2","masterbus":"usb.0","firstport":2,"bus":"pci.0","addr":"0x4.0x1"}' \ -device '{"driver":"ich9-usb-uhci3","masterbus":"usb.0","firstport":4,"bus":"pci.0","addr":"0x4.0x2"}' \ -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-ich9-companion.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-ich9-companion.x86_64-latest.xml index a43c29e341..8af1e43a11 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-companion.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-ich9-companion.x86_64-latest.xml @@ -36,8 +36,6 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-companion.xml b/tests/qemuxmlconfdata/usb-controller-ich9-companion.xml index aa5fb12727..9bc81f9126 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-companion.xml +++ b/tests/qemuxmlconfdata/usb-controller-ich9-companion.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> @@ -25,6 +23,6 @@ <master startport='4'/> <address type='pci' domain='0' bus='0' slot='4' function='2'/> </controller> - <memballoon model='virtio'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.args index 68b512e94b..2ac2bbe4aa 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.args @@ -39,6 +39,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"ich9-usb-uhci3","masterbus":"usb2.0","firstport":4,"bus":"pci.0","addr":"0x4.0x2"}' \ -device '{"driver":"ich9-usb-uhci2","masterbus":"usb2.0","firstport":2,"bus":"pci.0","addr":"0x4.0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x5"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.xml index 058880b2c4..50ebdb25e7 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.x86_64-latest.xml @@ -66,8 +66,6 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.xml b/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.xml index e5b0cf9eb6..314146019e 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.xml +++ b/tests/qemuxmlconfdata/usb-controller-ich9-ehci-addr.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> @@ -36,6 +34,6 @@ <controller type='usb' index='2' model='ich9-uhci2'/> <controller type='usb' index='1' model='ich9-uhci2'/> <controller type='usb' index='0' model='ich9-uhci2'/> - <memballoon model='virtio'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-ich9-no-companion.xml b/tests/qemuxmlconfdata/usb-controller-ich9-no-companion.xml index fbd1bbeb24..01dab2e1c7 100644 --- a/tests/qemuxmlconfdata/usb-controller-ich9-no-companion.xml +++ b/tests/qemuxmlconfdata/usb-controller-ich9-no-companion.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> @@ -14,8 +12,6 @@ <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0'/> </controller> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-i440fx.xml b/tests/qemuxmlconfdata/usb-controller-implicit-i440fx.xml index fc48ea3cde..801912352d 100644 --- a/tests/qemuxmlconfdata/usb-controller-implicit-i440fx.xml +++ b/tests/qemuxmlconfdata/usb-controller-implicit-i440fx.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-isapc.xml b/tests/qemuxmlconfdata/usb-controller-implicit-isapc.xml index 21be5b8cdf..55670290a6 100644 --- a/tests/qemuxmlconfdata/usb-controller-implicit-isapc.xml +++ b/tests/qemuxmlconfdata/usb-controller-implicit-isapc.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='isapc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-q35.xml b/tests/qemuxmlconfdata/usb-controller-implicit-q35.xml index ddeeadca97..51d327de8d 100644 --- a/tests/qemuxmlconfdata/usb-controller-implicit-q35.xml +++ b/tests/qemuxmlconfdata/usb-controller-implicit-q35.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='q35'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> diff --git a/tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.xml index 94cbbc2432..4d31f64a74 100644 --- a/tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.xml +++ b/tests/qemuxmlconfdata/usb-controller-nec-xhci-autoassign.xml @@ -2,24 +2,18 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0' model='nec-xhci' ports='8'/> <hub type='usb'/> - <input type='mouse' bus='usb'> - </input> - <hub type='usb'> - </hub> - <input type='mouse' bus='usb'> - </input> - <input type='mouse' bus='usb'> - </input> + <input type='mouse' bus='usb'/> + <hub type='usb'/> + <input type='mouse' bus='usb'/> + <input type='mouse' bus='usb'/> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-nec-xhci-limit.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci-limit.xml index 08a04183b6..7b29cb5aec 100644 --- a/tests/qemuxmlconfdata/usb-controller-nec-xhci-limit.xml +++ b/tests/qemuxmlconfdata/usb-controller-nec-xhci-limit.xml @@ -2,11 +2,9 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> diff --git a/tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml index e6f61c20c3..9039037ab7 100644 --- a/tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml @@ -17,13 +17,13 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='pci' index='0' model='pcie-root'/> <controller type='usb' index='0' model='nec-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-nec-xhci.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci.x86_64-latest.xml index e6f61c20c3..9039037ab7 100644 --- a/tests/qemuxmlconfdata/usb-controller-nec-xhci.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-nec-xhci.x86_64-latest.xml @@ -17,13 +17,13 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='pci' index='0' model='pcie-root'/> <controller type='usb' index='0' model='nec-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-nec-xhci.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci.xml index 55b8725008..4b0123b67a 100644 --- a/tests/qemuxmlconfdata/usb-controller-nec-xhci.xml +++ b/tests/qemuxmlconfdata/usb-controller-nec-xhci.xml @@ -2,19 +2,12 @@ <name>q35-test</name> <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='q35'>hvm</type> - <boot dev='hd'/> </os> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='pci' index='0' model='pcie-root'/> <controller type='usb' index='0' model='nec-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> diff --git a/tests/qemuxmlconfdata/usb-controller-piix3.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-piix3.x86_64-latest.args index b2d71ccb60..e4be4266bb 100644 --- a/tests/qemuxmlconfdata/usb-controller-piix3.x86_64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-piix3.x86_64-latest.args @@ -28,6 +28,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -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-piix3.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-piix3.x86_64-latest.xml index c74353b056..89631180ac 100644 --- a/tests/qemuxmlconfdata/usb-controller-piix3.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-piix3.x86_64-latest.xml @@ -24,8 +24,6 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-piix3.xml b/tests/qemuxmlconfdata/usb-controller-piix3.xml index 4d685c696f..4af0304d87 100644 --- a/tests/qemuxmlconfdata/usb-controller-piix3.xml +++ b/tests/qemuxmlconfdata/usb-controller-piix3.xml @@ -2,15 +2,13 @@ <name>QEMUGuest1</name> <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> </os> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0' model='piix3-uhci'/> - <memballoon model='virtio'/> + <memballoon model='none'/> </devices> </domain> -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:09 +0200, Andrea Bolognani via Devel wrote:
These tests are all about USB controllers and anything else is a distraction that we can happily live without.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

To usb-controller-automatic-*. This matches the existing q35 test, and in general makes more sense as a name since these tests are providing coverage for USB controllers getting automatically added by libvirt for new domains, rather than implicit (i.e. built-in, non-removable) devices. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...s => usb-controller-automatic-i440fx.x86_64-latest.args} | 0 ...ml => usb-controller-automatic-i440fx.x86_64-latest.xml} | 0 ...licit-i440fx.xml => usb-controller-automatic-i440fx.xml} | 0 ...gs => usb-controller-automatic-isapc.x86_64-latest.args} | 0 ...xml => usb-controller-automatic-isapc.x86_64-latest.xml} | 0 ...mplicit-isapc.xml => usb-controller-automatic-isapc.xml} | 0 ...args => usb-controller-automatic-q35.x86_64-latest.args} | 0 ...t.xml => usb-controller-automatic-q35.x86_64-latest.xml} | 0 ...er-implicit-q35.xml => usb-controller-automatic-q35.xml} | 0 tests/qemuxmlconftest.c | 6 +++--- 10 files changed, 3 insertions(+), 3 deletions(-) rename tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.x86_64-latest.args => usb-controller-automatic-i440fx.x86_64-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.x86_64-latest.xml => usb-controller-automatic-i440fx.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-i440fx.xml => usb-controller-automatic-i440fx.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.args => usb-controller-automatic-isapc.x86_64-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-isapc.x86_64-latest.xml => usb-controller-automatic-isapc.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-isapc.xml => usb-controller-automatic-isapc.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.args => usb-controller-automatic-q35.x86_64-latest.args} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-q35.x86_64-latest.xml => usb-controller-automatic-q35.x86_64-latest.xml} (100%) rename tests/qemuxmlconfdata/{usb-controller-implicit-q35.xml => usb-controller-automatic-q35.xml} (100%) diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-i440fx.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-i440fx.x86_64-latest.args similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-i440fx.x86_64-latest.args rename to tests/qemuxmlconfdata/usb-controller-automatic-i440fx.x86_64-latest.args diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-i440fx.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-i440fx.x86_64-latest.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-i440fx.x86_64-latest.xml rename to tests/qemuxmlconfdata/usb-controller-automatic-i440fx.x86_64-latest.xml diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-i440fx.xml b/tests/qemuxmlconfdata/usb-controller-automatic-i440fx.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-i440fx.xml rename to tests/qemuxmlconfdata/usb-controller-automatic-i440fx.xml diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-isapc.x86_64-latest.args similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-latest.args rename to tests/qemuxmlconfdata/usb-controller-automatic-isapc.x86_64-latest.args diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-isapc.x86_64-latest.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-latest.xml rename to tests/qemuxmlconfdata/usb-controller-automatic-isapc.x86_64-latest.xml diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-isapc.xml b/tests/qemuxmlconfdata/usb-controller-automatic-isapc.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-isapc.xml rename to tests/qemuxmlconfdata/usb-controller-automatic-isapc.xml diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-q35.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-q35.x86_64-latest.args similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-q35.x86_64-latest.args rename to tests/qemuxmlconfdata/usb-controller-automatic-q35.x86_64-latest.args diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-q35.x86_64-latest.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-q35.x86_64-latest.xml rename to tests/qemuxmlconfdata/usb-controller-automatic-q35.x86_64-latest.xml diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-q35.xml b/tests/qemuxmlconfdata/usb-controller-automatic-q35.xml similarity index 100% rename from tests/qemuxmlconfdata/usb-controller-implicit-q35.xml rename to tests/qemuxmlconfdata/usb-controller-automatic-q35.xml diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index e9993bc8a0..a31846ba8e 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1929,9 +1929,9 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("chardev-reconnect-invalid-timeout"); DO_TEST_CAPS_LATEST_PARSE_ERROR("chardev-reconnect-generated-path"); - DO_TEST_CAPS_LATEST("usb-controller-implicit-isapc"); - DO_TEST_CAPS_LATEST("usb-controller-implicit-i440fx"); - DO_TEST_CAPS_LATEST("usb-controller-implicit-q35"); + DO_TEST_CAPS_LATEST("usb-controller-automatic-isapc"); + DO_TEST_CAPS_LATEST("usb-controller-automatic-i440fx"); + DO_TEST_CAPS_LATEST("usb-controller-automatic-q35"); DO_TEST_CAPS_LATEST_PARSE_ERROR("usb-controller-default-isapc"); DO_TEST_CAPS_LATEST("usb-controller-default-i440fx"); DO_TEST_CAPS_LATEST("usb-controller-default-q35"); -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:10 +0200, Andrea Bolognani via Devel wrote:
To usb-controller-automatic-*.
This matches the existing q35 test, and in general makes more sense as a name since these tests are providing coverage for USB controllers getting automatically added by libvirt for new domains, rather than implicit (i.e. built-in, non-removable) devices.
IIRC these controllers are actually part i440fx chipset, thus technically implicit although they can be disabled unlike in real hardware. I don't mind the actual namig change though. Consider updating the commit message. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

We're missing a significant number of scenarios, including those involving fairly common machine types and architectures. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...matic-pseries.ppc64-latest.abi-update.args | 32 ++++++++++ ...omatic-pseries.ppc64-latest.abi-update.xml | 31 ++++++++++ ...roller-automatic-pseries.ppc64-latest.args | 32 ++++++++++ ...troller-automatic-pseries.ppc64-latest.xml | 31 ++++++++++ .../usb-controller-automatic-pseries.xml | 13 ++++ ...ler-automatic-realview.aarch64-latest.args | 31 ++++++++++ ...ller-automatic-realview.aarch64-latest.xml | 22 +++++++ .../usb-controller-automatic-realview.xml | 14 +++++ ...ntroller-automatic-s390x.s390x-latest.args | 31 ++++++++++ ...ontroller-automatic-s390x.s390x-latest.xml | 25 ++++++++ .../usb-controller-automatic-s390x.xml | 13 ++++ ...ilable-pseries.ppc64-latest.abi-update.err | 1 + ...ilable-pseries.ppc64-latest.abi-update.xml | 31 ++++++++++ ...matic-unavailable-pseries.ppc64-latest.err | 1 + ...matic-unavailable-pseries.ppc64-latest.xml | 31 ++++++++++ ...ntroller-automatic-unavailable-pseries.xml | 1 + ...ic-unavailable-realview.aarch64-latest.err | 1 + ...ic-unavailable-realview.aarch64-latest.xml | 22 +++++++ ...troller-automatic-unavailable-realview.xml | 1 + ...-unavailable-versatilepb.armv7l-latest.err | 1 + ...-unavailable-versatilepb.armv7l-latest.xml | 27 ++++++++ ...ller-automatic-unavailable-versatilepb.xml | 1 + ...r-automatic-versatilepb.armv7l-latest.args | 32 ++++++++++ ...er-automatic-versatilepb.armv7l-latest.xml | 27 ++++++++ .../usb-controller-automatic-versatilepb.xml | 13 ++++ ...automatic-virt-aarch64.aarch64-latest.args | 31 ++++++++++ ...-automatic-virt-aarch64.aarch64-latest.xml | 26 ++++++++ .../usb-controller-automatic-virt-aarch64.xml | 12 ++++ ...c-virt-loongarch64.loongarch64-latest.args | 31 ++++++++++ ...ic-virt-loongarch64.loongarch64-latest.xml | 23 +++++++ ...-controller-automatic-virt-loongarch64.xml | 12 ++++ ...automatic-virt-riscv64.riscv64-latest.args | 31 ++++++++++ ...-automatic-virt-riscv64.riscv64-latest.xml | 24 ++++++++ .../usb-controller-automatic-virt-riscv64.xml | 13 ++++ ...-fallback-virt-aarch64.aarch64-latest.args | 35 +++++++++++ ...t-fallback-virt-aarch64.aarch64-latest.xml | 43 +++++++++++++ ...ntroller-default-fallback-virt-aarch64.xml | 1 + ...controller-default-s390x.s390x-latest.args | 31 ++++++++++ ...-controller-default-s390x.s390x-latest.xml | 26 ++++++++ .../usb-controller-default-s390x.xml | 14 +++++ ...navailable-virt-aarch64.aarch64-latest.err | 1 + ...navailable-virt-aarch64.aarch64-latest.xml | 43 +++++++++++++ ...oller-default-unavailable-virt-aarch64.xml | 1 + ...navailable-virt-riscv64.riscv64-latest.err | 1 + ...navailable-virt-riscv64.riscv64-latest.xml | 41 +++++++++++++ ...oller-default-unavailable-virt-riscv64.xml | 1 + ...r-default-virt-aarch64.aarch64-latest.args | 34 +++++++++++ ...er-default-virt-aarch64.aarch64-latest.xml | 39 ++++++++++++ .../usb-controller-default-virt-aarch64.xml | 13 ++++ ...t-virt-loongarch64.loongarch64-latest.args | 34 +++++++++++ ...lt-virt-loongarch64.loongarch64-latest.xml | 36 +++++++++++ ...sb-controller-default-virt-loongarch64.xml | 13 ++++ ...r-default-virt-riscv64.riscv64-latest.args | 35 +++++++++++ ...er-default-virt-riscv64.riscv64-latest.xml | 41 +++++++++++++ .../usb-controller-default-virt-riscv64.xml | 14 +++++ tests/qemuxmlconftest.c | 61 +++++++++++++++++++ 56 files changed, 1226 insertions(+) create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.abi-update.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.abi-update.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-pseries.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-realview.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-s390x.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-s390x.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-s390x.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.err create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.err create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml create mode 120000 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml create mode 120000 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml create mode 120000 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.aarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.loongarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.loongarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.riscv64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.riscv64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-s390x.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-s390x.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-s390x.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.err create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.err create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.aarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.loongarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.loongarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.xml diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.abi-update.args b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.abi-update.args new file mode 100644 index 0000000000..3d8df5ff6f --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.abi-update.args @@ -0,0 +1,32 @@ +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 pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \ +-accel tcg \ +-cpu POWER10 \ +-m size=262144k \ +-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.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 \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-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-automatic-pseries.ppc64-latest.abi-update.xml b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.abi-update.xml new file mode 100644 index 0000000000..1c11a18b28 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.abi-update.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER10</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.args new file mode 100644 index 0000000000..1859e1f5f9 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.args @@ -0,0 +1,32 @@ +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 pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \ +-accel tcg \ +-cpu POWER10 \ +-m size=262144k \ +-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.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 \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-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-automatic-pseries.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.xml new file mode 100644 index 0000000000..e92535a1f9 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.ppc64-latest.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER10</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0' model='pci-ohci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-pseries.xml b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.xml new file mode 100644 index 0000000000..9951364e5c --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-pseries.xml @@ -0,0 +1,13 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args new file mode 100644 index 0000000000..84a88aad58 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=aarch64test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ +-machine realview-pbx-a9,usb=off,dump-guest-core=off \ +-accel kvm \ +-cpu host \ +-m size=1048576k \ +-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 \ +-device '{"driver":"pci-ohci","id":"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-automatic-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml new file mode 100644 index 0000000000..372d5bda6a --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-passthrough' check='none'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' index='0' model='pci-ohci'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.xml b/tests/qemuxmlconfdata/usb-controller-automatic-realview.xml new file mode 100644 index 0000000000..b58b207299 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.xml @@ -0,0 +1,14 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + </os> + <cpu mode='host-passthrough'/> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-s390x.s390x-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-s390x.s390x-latest.args new file mode 100644 index 0000000000..77901f73fe --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-s390x.s390x-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel tcg \ +-cpu qemu \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-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 \ +-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-automatic-s390x.s390x-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-s390x.s390x-latest.xml new file mode 100644 index 0000000000..60d84a81de --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-s390x.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-s390x.xml b/tests/qemuxmlconfdata/usb-controller-automatic-s390x.xml new file mode 100644 index 0000000000..4f8b9c62aa --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-s390x.xml @@ -0,0 +1,13 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.err b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.err new file mode 100644 index 0000000000..cac4e8e760 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.err @@ -0,0 +1 @@ +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml new file mode 100644 index 0000000000..2b71e447e8 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER10</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.err b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.err new file mode 100644 index 0000000000..cac4e8e760 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.err @@ -0,0 +1 @@ +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml new file mode 100644 index 0000000000..2b71e447e8 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER10</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.xml new file mode 120000 index 0000000000..c3ab9c9e9c --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.xml @@ -0,0 +1 @@ +usb-controller-automatic-pseries.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err new file mode 100644 index 0000000000..918b72dbe9 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err @@ -0,0 +1 @@ +unsupported configuration: USB controller model 'pci-ohci' not supported in this QEMU binary diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml new file mode 100644 index 0000000000..372d5bda6a --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-passthrough' check='none'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' index='0' model='pci-ohci'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.xml new file mode 120000 index 0000000000..ba1fa87882 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.xml @@ -0,0 +1 @@ +usb-controller-automatic-realview.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err new file mode 100644 index 0000000000..918b72dbe9 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err @@ -0,0 +1 @@ +unsupported configuration: USB controller model 'pci-ohci' not supported in this QEMU binary diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml new file mode 100644 index 0000000000..482029e3b0 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml @@ -0,0 +1,27 @@ +<domain type='qemu'> + <name>armv7ltest</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='armv7l' machine='versatilepb'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>arm926</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-armv7l</emulator> + <controller type='usb' index='0' model='pci-ohci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.xml new file mode 120000 index 0000000000..298462345e --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.xml @@ -0,0 +1 @@ +usb-controller-automatic-versatilepb.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args new file mode 100644 index 0000000000..a05a413290 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args @@ -0,0 +1,32 @@ +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 \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-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-automatic-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml new file mode 100644 index 0000000000..482029e3b0 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml @@ -0,0 +1,27 @@ +<domain type='qemu'> + <name>armv7ltest</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='armv7l' machine='versatilepb'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>arm926</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-armv7l</emulator> + <controller type='usb' index='0' model='pci-ohci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.xml b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.xml new file mode 100644 index 0000000000..77cd254048 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.xml @@ -0,0 +1,13 @@ +<domain type='qemu'> + <name>armv7ltest</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='armv7l' machine='versatilepb'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-armv7l</emulator> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.aarch64-latest.args new file mode 100644 index 0000000000..e2cd8cd4b8 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.aarch64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ +-accel tcg \ +-cpu cortex-a15 \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.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 \ +-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-automatic-virt-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.aarch64-latest.xml new file mode 100644 index 0000000000..7a4ce16fbc --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.aarch64-latest.xml @@ -0,0 +1,26 @@ +<domain type='qemu'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='2'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>cortex-a15</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.xml b/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.xml new file mode 100644 index 0000000000..d299e4c921 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-aarch64.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.loongarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.loongarch64-latest.args new file mode 100644 index 0000000000..cb73962813 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.loongarch64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-loongarch64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=loongarch.ram,acpi=off \ +-accel tcg \ +-cpu la464 \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"loongarch.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 \ +-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-automatic-virt-loongarch64.loongarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.loongarch64-latest.xml new file mode 100644 index 0000000000..9b1537888b --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.loongarch64-latest.xml @@ -0,0 +1,23 @@ +<domain type='qemu'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='loongarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>la464</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-loongarch64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.xml b/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.xml new file mode 100644 index 0000000000..9284108967 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-loongarch64.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='loongarch64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-loongarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.riscv64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.riscv64-latest.args new file mode 100644 index 0000000000..5413ca8b57 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.riscv64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram,acpi=off \ +-accel tcg \ +-cpu rv64 \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.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 \ +-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-automatic-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.riscv64-latest.xml new file mode 100644 index 0000000000..675af30032 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.riscv64-latest.xml @@ -0,0 +1,24 @@ +<domain type='qemu'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>rv64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.xml b/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.xml new file mode 100644 index 0000000000..857f441f19 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-automatic-virt-riscv64.xml @@ -0,0 +1,13 @@ +<domain type='qemu'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args new file mode 100644 index 0000000000..63ea7be2aa --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ +-accel tcg \ +-cpu cortex-a15 \ +-m size=2097152k \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-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 \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ +-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-fallback-virt-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml new file mode 100644 index 0000000000..cea6dde62d --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml @@ -0,0 +1,43 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='2'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>cortex-a15</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.xml new file mode 120000 index 0000000000..733722d618 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.xml @@ -0,0 +1 @@ +usb-controller-default-virt-aarch64.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-s390x.s390x-latest.args b/tests/qemuxmlconfdata/usb-controller-default-s390x.s390x-latest.args new file mode 100644 index 0000000000..77901f73fe --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-s390x.s390x-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel tcg \ +-cpu qemu \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-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 \ +-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-s390x.s390x-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-s390x.s390x-latest.xml new file mode 100644 index 0000000000..98b5d46bf6 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-s390x.s390x-latest.xml @@ -0,0 +1,26 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-s390x.xml b/tests/qemuxmlconfdata/usb-controller-default-s390x.xml new file mode 100644 index 0000000000..f260444f47 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-s390x.xml @@ -0,0 +1,14 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='usb' index='0'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.err new file mode 100644 index 0000000000..cac4e8e760 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.err @@ -0,0 +1 @@ +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml new file mode 100644 index 0000000000..81ddb4e5d9 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml @@ -0,0 +1,43 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='2'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>cortex-a15</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.xml new file mode 120000 index 0000000000..733722d618 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.xml @@ -0,0 +1 @@ +usb-controller-default-virt-aarch64.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.err new file mode 100644 index 0000000000..cac4e8e760 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.err @@ -0,0 +1 @@ +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml new file mode 100644 index 0000000000..686363457e --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml @@ -0,0 +1,41 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>rv64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.xml new file mode 120000 index 0000000000..061240f8f2 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.xml @@ -0,0 +1 @@ +usb-controller-default-virt-riscv64.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.aarch64-latest.args new file mode 100644 index 0000000000..270f02dd1f --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.aarch64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ +-accel tcg \ +-cpu cortex-a15 \ +-m size=2097152k \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-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 \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \ +-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-virt-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.aarch64-latest.xml new file mode 100644 index 0000000000..94f4776da0 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.aarch64-latest.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='2'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>cortex-a15</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.xml new file mode 100644 index 0000000000..0f4ba7970f --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-aarch64.xml @@ -0,0 +1,13 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' index='0'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.loongarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.loongarch64-latest.args new file mode 100644 index 0000000000..04b70a2dba --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.loongarch64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-loongarch64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=loongarch.ram,acpi=off \ +-accel tcg \ +-cpu la464 \ +-m size=2097152k \ +-object '{"qom-type":"memory-backend-ram","id":"loongarch.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-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 \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \ +-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-virt-loongarch64.loongarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.loongarch64-latest.xml new file mode 100644 index 0000000000..0a225e3c16 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.loongarch64-latest.xml @@ -0,0 +1,36 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='loongarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>la464</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-loongarch64</emulator> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.xml new file mode 100644 index 0000000000..6322ceda6e --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-loongarch64.xml @@ -0,0 +1,13 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='loongarch64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-loongarch64</emulator> + <controller type='usb' index='0'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args new file mode 100644 index 0000000000..20ef922cf6 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram,acpi=off \ +-accel tcg \ +-cpu rv64 \ +-m size=2097152k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-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 \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ +-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-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml new file mode 100644 index 0000000000..28f2c9eca4 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml @@ -0,0 +1,41 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>rv64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.xml new file mode 100644 index 0000000000..e0d956232a --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.xml @@ -0,0 +1,14 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='usb' index='0'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index a31846ba8e..dea8b1af14 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1932,6 +1932,43 @@ mymain(void) DO_TEST_CAPS_LATEST("usb-controller-automatic-isapc"); DO_TEST_CAPS_LATEST("usb-controller-automatic-i440fx"); DO_TEST_CAPS_LATEST("usb-controller-automatic-q35"); + DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-pseries", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("usb-controller-automatic-pseries", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-s390x", "s390x"); + DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-virt-aarch64", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-virt-riscv64", "riscv64"); + DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-virt-loongarch64", "loongarch64"); + + DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-versatilepb", "armv7l"); + DO_TEST_FULL("usb-controller-automatic-unavailable-versatilepb", ".armv7l-latest", + ARG_CAPS_ARCH, "armv7l", + ARG_CAPS_VER, "latest", + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_END); + + DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-realview", "aarch64"); + DO_TEST_FULL("usb-controller-automatic-unavailable-realview", ".aarch64-latest", + ARG_CAPS_ARCH, "aarch64", + ARG_CAPS_VER, "latest", + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_END); + + DO_TEST_FULL("usb-controller-automatic-unavailable-pseries", ".ppc64-latest", + ARG_CAPS_ARCH, "ppc64", + ARG_CAPS_VER, "latest", + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_END); + DO_TEST_FULL("usb-controller-automatic-unavailable-pseries", ".ppc64-latest.abi-update", + ARG_CAPS_ARCH, "ppc64", + ARG_CAPS_VER, "latest", + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_END); + DO_TEST_CAPS_LATEST_PARSE_ERROR("usb-controller-default-isapc"); DO_TEST_CAPS_LATEST("usb-controller-default-i440fx"); DO_TEST_CAPS_LATEST("usb-controller-default-q35"); @@ -1941,6 +1978,9 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-mac99", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-mac99ppc", "ppc"); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-powernv9", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-s390x", "s390x"); + DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-virt-loongarch64", "loongarch64"); + /* Until qemu-8.1 (see commit 6fe4464c05f) it was possible to compile * out USB support from i440fx; the implicit -usb controller still failed */ DO_TEST_FULL("usb-controller-default-unavailable-i440fx", ".x86_64-latest", @@ -1973,6 +2013,27 @@ mymain(void) 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_ARCH_LATEST("usb-controller-default-virt-aarch64", "aarch64"); + DO_TEST_FULL("usb-controller-default-fallback-virt-aarch64", ".aarch64-latest", + ARG_CAPS_ARCH, "aarch64", + ARG_CAPS_VER, "latest", + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, + ARG_END); + DO_TEST_FULL("usb-controller-default-unavailable-virt-aarch64", ".aarch64-latest", + ARG_CAPS_ARCH, "aarch64", + ARG_CAPS_VER, "latest", + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_END); + + DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-virt-riscv64", "riscv64"); + DO_TEST_FULL("usb-controller-default-unavailable-virt-riscv64", ".riscv64-latest", + ARG_CAPS_ARCH, "riscv64", + ARG_CAPS_VER, "latest", + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_END); + /* controller selection tests for various uncommon machine types */ DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-versatilepb", "armv7l"); DO_TEST_FULL("usb-controller-default-fallback-versatilepb", ".armv7l-latest", -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:11 +0200, Andrea Bolognani via Devel wrote:
We're missing a significant number of scenarios, including those involving fairly common machine types and architectures.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

These tests are intended to show what happens when the device that libvirt would use by default is not available in QEMU by dropping the corresponding capabilities, but we're not doing that correctly at the moment and so we still get the default USB controller instead of a failure. Note that the usb-controller-automatic-unavailable tests are still behaving the same despite dropping all the expected capabilities: the reason is that, for that scenario, we're not currently checking whether the device is available before using it. That's a separate issue that will be addressed in an upcoming commit. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...ault-unavailable-nousb.aarch64-latest.args | 32 ------------------- ...fault-unavailable-nousb.aarch64-latest.err | 1 + ...fault-unavailable-nousb.aarch64-latest.xml | 2 +- ...t-unavailable-realview.aarch64-latest.args | 31 ------------------ ...lt-unavailable-realview.aarch64-latest.err | 1 + ...lt-unavailable-realview.aarch64-latest.xml | 2 +- tests/qemuxmlconftest.c | 12 ++++--- 7 files changed, 11 insertions(+), 70 deletions(-) delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.err diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.args deleted file mode 100644 index 0fb2909dd2..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine collie,usb=off,dump-guest-core=off,memory-backend=strongarm.sdram \ --accel kvm \ --cpu host \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"strongarm.sdram","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 \ --device '{"driver":"qemu-xhci","id":"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-nousb.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err new file mode 100644 index 0000000000..cac4e8e760 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err @@ -0,0 +1 @@ +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml index fa258c5671..ac5f270a3a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml @@ -15,7 +15,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='qemu-xhci'/> + <controller type='usb' index='0'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.args deleted file mode 100644 index 446ca8aa42..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.args +++ /dev/null @@ -1,31 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine realview-pbx-a9,usb=off,dump-guest-core=off \ --accel kvm \ --cpu host \ --m size=1048576k \ --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 \ --device '{"driver":"qemu-xhci","id":"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-realview.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.err new file mode 100644 index 0000000000..cac4e8e760 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.err @@ -0,0 +1 @@ +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml index f37501b769..dfa8ef8dbe 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml @@ -15,7 +15,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='qemu-xhci'/> + <controller type='usb' index='0'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index dea8b1af14..26afdf7a7e 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1944,7 +1944,7 @@ mymain(void) ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_FAILURE, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-realview", "aarch64"); @@ -1952,7 +1952,7 @@ mymain(void) ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_FAILURE, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-automatic-unavailable-pseries", ".ppc64-latest", @@ -2045,7 +2045,7 @@ mymain(void) 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_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-realview", "aarch64"); @@ -2057,7 +2057,8 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-realview", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); /* The '-nousb' test case tests machine without a built-in USB controller */ @@ -2070,7 +2071,8 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-nousb", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-default-fallback-g3beige", ".ppc64-latest", -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:12 +0200, Andrea Bolognani via Devel wrote:
These tests are intended to show what happens when the device that libvirt would use by default is not available in QEMU by dropping the corresponding capabilities, but we're not doing that correctly at the moment and so we still get the default USB controller instead of a failure.
Do I understand correctly (from the diff) that the "incorrect" approach is that the tests copied the list of the controllers to remove from the x86 cases and thus the aarch tests still picked the default they'd pick normally? Preferrably clarify this in the commit message.
Note that the usb-controller-automatic-unavailable tests are still behaving the same despite dropping all the expected capabilities: the reason is that, for that scenario, we're not currently checking whether the device is available before using it. That's a separate issue that will be addressed in an upcoming commit.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
[...]
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index dea8b1af14..26afdf7a7e 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1944,7 +1944,7 @@ mymain(void) ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_FAILURE, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END);
Alternatively shouldn't this keep some of the non-default ones if the we're selecting another option? Reviewed-by: Peter Krempa <pkrempa@redhat.com>

We assign the USB controller model without first checking whether the corresponding QEMU device is available, and that results in a late error instead of an early one. Be consistent with how we do things in all other cases and check the presence of the capability before attempting to set the model. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 3 ++- ...ontroller-automatic-unavailable-realview.aarch64-latest.err | 2 +- ...ontroller-automatic-unavailable-realview.aarch64-latest.xml | 2 +- ...troller-automatic-unavailable-versatilepb.armv7l-latest.err | 2 +- ...troller-automatic-unavailable-versatilepb.armv7l-latest.xml | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 9c2427970d..5f59b79d56 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1299,7 +1299,8 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, if (STREQ(def->os.machine, "versatilepb") || STRPREFIX(def->os.machine, "realview")) { addDefaultUSB = true; - usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; } if (qemuDomainIsARMVirt(def)) diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err index 918b72dbe9..cac4e8e760 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.err @@ -1 +1 @@ -unsupported configuration: USB controller model 'pci-ohci' not supported in this QEMU binary +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml index 372d5bda6a..dfa8ef8dbe 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml @@ -15,7 +15,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'/> + <controller type='usb' index='0'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err index 918b72dbe9..cac4e8e760 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.err @@ -1 +1 @@ -unsupported configuration: USB controller model 'pci-ohci' not supported in this QEMU binary +internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml index 482029e3b0..93bf8dcd0a 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml @@ -17,7 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:13 +0200, Andrea Bolognani via Devel wrote:
We assign the USB controller model without first checking whether the corresponding QEMU device is available, and that results in a late error instead of an early one.
Be consistent with how we do things in all other cases and check the presence of the capability before attempting to set the model.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 3 ++- ...ontroller-automatic-unavailable-realview.aarch64-latest.err | 2 +- ...ontroller-automatic-unavailable-realview.aarch64-latest.xml | 2 +- ...troller-automatic-unavailable-versatilepb.armv7l-latest.err | 2 +- ...troller-automatic-unavailable-versatilepb.armv7l-latest.xml | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

QEMU implements 4 different "realview" machine types: $ qemu-system-aarch64 -machine help 2>&1 | grep realview realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S) realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore) realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8 realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9 Of these, only the -eb variants support PCI devices and are thus relevant when it comes to USB controllers. Our logic treats all these machine types the same, which is incorrect. An upcoming commit will fix the issue; in preparation for that, make some adjustments to the test suite. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../aarch64-realview-minimal.aarch64-latest.abi-update.args | 2 +- .../aarch64-realview-minimal.aarch64-latest.abi-update.xml | 2 +- .../aarch64-realview-minimal.aarch64-latest.args | 2 +- .../qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml | 2 +- tests/qemuxmlconfdata/aarch64-realview-minimal.xml | 2 +- .../usb-controller-automatic-realview.aarch64-latest.args | 2 +- .../usb-controller-automatic-realview.aarch64-latest.xml | 2 +- tests/qemuxmlconfdata/usb-controller-automatic-realview.xml | 2 +- ...controller-automatic-unavailable-realview.aarch64-latest.xml | 2 +- ...usb-controller-default-fallback-realview.aarch64-latest.args | 2 +- .../usb-controller-default-fallback-realview.aarch64-latest.xml | 2 +- .../usb-controller-default-realview.aarch64-latest.args | 2 +- .../usb-controller-default-realview.aarch64-latest.xml | 2 +- tests/qemuxmlconfdata/usb-controller-default-realview.xml | 2 +- ...b-controller-default-unavailable-realview.aarch64-latest.xml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args index 84a88aad58..fc88d9cf6b 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -name guest=aarch64test,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine realview-pbx-a9,usb=off,dump-guest-core=off \ +-machine realview-eb,usb=off,dump-guest-core=off \ -accel kvm \ -cpu host \ -m size=1048576k \ diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml index de44852e4e..b16454b94c 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> <boot dev='hd'/> </os> <cpu mode='host-passthrough' check='none'/> diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args index 84a88aad58..fc88d9cf6b 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -name guest=aarch64test,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine realview-pbx-a9,usb=off,dump-guest-core=off \ +-machine realview-eb,usb=off,dump-guest-core=off \ -accel kvm \ -cpu host \ -m size=1048576k \ diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml index de44852e4e..b16454b94c 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> <boot dev='hd'/> </os> <cpu mode='host-passthrough' check='none'/> diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.xml index 2502e5d795..7362ad46b8 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.xml @@ -4,7 +4,7 @@ <memory unit='KiB'>1048576</memory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> </os> <cpu mode='host-passthrough'/> <devices> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args index 84a88aad58..fc88d9cf6b 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -name guest=aarch64test,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine realview-pbx-a9,usb=off,dump-guest-core=off \ +-machine realview-eb,usb=off,dump-guest-core=off \ -accel kvm \ -cpu host \ -m size=1048576k \ diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml index 372d5bda6a..dc32fd50cd 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> <boot dev='hd'/> </os> <cpu mode='host-passthrough' check='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.xml b/tests/qemuxmlconfdata/usb-controller-automatic-realview.xml index b58b207299..0814d9bd62 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.xml @@ -4,7 +4,7 @@ <memory unit='KiB'>1048576</memory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> </os> <cpu mode='host-passthrough'/> <devices> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml index dfa8ef8dbe..9da9abaa88 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> <boot dev='hd'/> </os> <cpu mode='host-passthrough' check='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args index 446ca8aa42..604c5ec473 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -name guest=aarch64test,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine realview-pbx-a9,usb=off,dump-guest-core=off \ +-machine realview-eb,usb=off,dump-guest-core=off \ -accel kvm \ -cpu host \ -m size=1048576k \ diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml index f37501b769..f61322ddb5 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> <boot dev='hd'/> </os> <cpu mode='host-passthrough' check='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args index 446ca8aa42..604c5ec473 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -name guest=aarch64test,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine realview-pbx-a9,usb=off,dump-guest-core=off \ +-machine realview-eb,usb=off,dump-guest-core=off \ -accel kvm \ -cpu host \ -m size=1048576k \ diff --git a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml index f37501b769..f61322ddb5 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> <boot dev='hd'/> </os> <cpu mode='host-passthrough' check='none'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-realview.xml b/tests/qemuxmlconfdata/usb-controller-default-realview.xml index 8068d29515..5e5aae7f06 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-realview.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-realview.xml @@ -4,7 +4,7 @@ <memory unit='KiB'>1048576</memory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> </os> <cpu mode='host-passthrough'/> <devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml index dfa8ef8dbe..9da9abaa88 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='aarch64' machine='realview-pbx-a9'>hvm</type> + <type arch='aarch64' machine='realview-eb'>hvm</type> <boot dev='hd'/> </os> <cpu mode='host-passthrough' check='none'/> -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:14 +0200, Andrea Bolognani via Devel wrote:
QEMU implements 4 different "realview" machine types:
$ qemu-system-aarch64 -machine help 2>&1 | grep realview realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S) realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore) realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8 realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9
Of these, only the -eb variants support PCI devices and are thus relevant when it comes to USB controllers.
Our logic treats all these machine types the same, which is incorrect. An upcoming commit will fix the issue; in preparation for that, make some adjustments to the test suite.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Only the -eb variants of the realview board support PCI devices, so those are the only ones that should automatically get a USB controller (addDefaultUSB). Additionally, they should get a PCI controller added automatically (addPCIRoot) too, same as versatilepb. Finally, qemuDomainSupportsPCI() should correctly report the fact that these machine types support PCI. As a consequence of these fixes, the USB controllers now correctly get assigned PCI addresses across the board. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 3 ++- src/qemu/qemu_postparse.c | 10 ++++------ ...h64-realview-minimal.aarch64-latest.abi-update.args | 2 +- ...ch64-realview-minimal.aarch64-latest.abi-update.xml | 5 ++++- .../aarch64-realview-minimal.aarch64-latest.args | 2 +- .../aarch64-realview-minimal.aarch64-latest.xml | 5 ++++- ...b-controller-automatic-realview.aarch64-latest.args | 2 +- ...sb-controller-automatic-realview.aarch64-latest.xml | 5 ++++- ...r-automatic-unavailable-realview.aarch64-latest.xml | 5 ++++- ...oller-default-fallback-realview.aarch64-latest.args | 2 +- ...roller-default-fallback-realview.aarch64-latest.xml | 5 ++++- ...usb-controller-default-realview.aarch64-latest.args | 2 +- .../usb-controller-default-realview.aarch64-latest.xml | 5 ++++- ...ler-default-unavailable-realview.aarch64-latest.xml | 5 ++++- 14 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e45757ccd5..81a8ca906d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7688,7 +7688,8 @@ qemuDomainSupportsPCI(const virDomainDef *def) * machine types support PCI */ if (ARCH_IS_ARM(def->os.arch)) { if (qemuDomainIsARMVirt(def) || - STREQ(def->os.machine, "versatilepb")) { + STREQ(def->os.machine, "versatilepb") || + STRPREFIX(def->os.machine, "realview-eb")) { return true; } return false; diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 5f59b79d56..3c481ead5e 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1291,13 +1291,11 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_ARMV7L: case VIR_ARCH_ARMV7B: case VIR_ARCH_AARCH64: - if (STREQ(def->os.machine, "versatilepb")) - addPCIRoot = true; - - /* Add default USB for the two machine types which historically - * supported -usb */ + /* Add default PCI and USB for the two machine types which + * historically supported -usb */ if (STREQ(def->os.machine, "versatilepb") || - STRPREFIX(def->os.machine, "realview")) { + STRPREFIX(def->os.machine, "realview-eb")) { + addPCIRoot = true; addDefaultUSB = true; if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args index fc88d9cf6b..0d956241fc 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml index b16454b94c..c31c7b2bbc 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml @@ -15,7 +15,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'/> + <controller type='usb' index='0' model='pci-ohci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args index fc88d9cf6b..0d956241fc 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml index b16454b94c..c31c7b2bbc 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml @@ -15,7 +15,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'/> + <controller type='usb' index='0' model='pci-ohci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args index fc88d9cf6b..0d956241fc 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ -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-automatic-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml index dc32fd50cd..250da1b5e0 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml @@ -15,7 +15,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'/> + <controller type='usb' index='0' model='pci-ohci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml index 9da9abaa88..128a7d420e 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml @@ -15,7 +15,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0'/> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args index 604c5ec473..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"qemu-xhci","id":"usb"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -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-fallback-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml index f61322ddb5..8bb25de20a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml @@ -15,7 +15,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='qemu-xhci'/> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args index 604c5ec473..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"qemu-xhci","id":"usb"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -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-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml index f61322ddb5..8bb25de20a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml @@ -15,7 +15,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='qemu-xhci'/> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml index 9da9abaa88..128a7d420e 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml @@ -15,7 +15,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0'/> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:15 +0200, Andrea Bolognani via Devel wrote:
Only the -eb variants of the realview board support PCI devices, so those are the only ones that should automatically get a USB controller (addDefaultUSB).
You don't mention what the consequence of the originally bad choice is. Did the VM fail to start if the OHCI controller was used on the board/machine type without PCI? While the chance for people to hit regressions are low as not many people use these we still ought to keep our compat promise.
Additionally, they should get a PCI controller added automatically (addPCIRoot) too, same as versatilepb.
Finally, qemuDomainSupportsPCI() should correctly report the fact that these machine types support PCI.
As a consequence of these fixes, the USB controllers now correctly get assigned PCI addresses across the board.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 3 ++- src/qemu/qemu_postparse.c | 10 ++++------ ...h64-realview-minimal.aarch64-latest.abi-update.args | 2 +- ...ch64-realview-minimal.aarch64-latest.abi-update.xml | 5 ++++- .../aarch64-realview-minimal.aarch64-latest.args | 2 +- .../aarch64-realview-minimal.aarch64-latest.xml | 5 ++++- ...b-controller-automatic-realview.aarch64-latest.args | 2 +- ...sb-controller-automatic-realview.aarch64-latest.xml | 5 ++++- ...r-automatic-unavailable-realview.aarch64-latest.xml | 5 ++++- ...oller-default-fallback-realview.aarch64-latest.args | 2 +- ...roller-default-fallback-realview.aarch64-latest.xml | 5 ++++- ...usb-controller-default-realview.aarch64-latest.args | 2 +- .../usb-controller-default-realview.aarch64-latest.xml | 5 ++++- ...ler-default-unavailable-realview.aarch64-latest.xml | 5 ++++- 14 files changed, 39 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e45757ccd5..81a8ca906d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7688,7 +7688,8 @@ qemuDomainSupportsPCI(const virDomainDef *def) * machine types support PCI */ if (ARCH_IS_ARM(def->os.arch)) { if (qemuDomainIsARMVirt(def) || - STREQ(def->os.machine, "versatilepb")) { + STREQ(def->os.machine, "versatilepb") || + STRPREFIX(def->os.machine, "realview-eb")) { return true; } return false; diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 5f59b79d56..3c481ead5e 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1291,13 +1291,11 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_ARMV7L: case VIR_ARCH_ARMV7B: case VIR_ARCH_AARCH64: - if (STREQ(def->os.machine, "versatilepb")) - addPCIRoot = true; - - /* Add default USB for the two machine types which historically - * supported -usb */ + /* Add default PCI and USB for the two machine types which + * historically supported -usb */ if (STREQ(def->os.machine, "versatilepb") || - STRPREFIX(def->os.machine, "realview")) { + STRPREFIX(def->os.machine, "realview-eb")) { + addPCIRoot = true; addDefaultUSB = true; if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI;
So if 'realview' machine with default USB worked before I don't think you should remove it here. If it didn't work please update the commit message and use: Reviewed-by: Peter Krempa <pkrempa@redhat.com>

The isapc machine type doesn't support PCI, so attempting to add a PCI controller should fail. It currently doesn't, and we're going to address that in an upcoming commit. Note that the domain gets a PCI memballoon device added automatically. That also shouldn't happen, and will similarly be fixed. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../isapc-pci.x86_64-latest.args | 32 +++++++++++++++++++ .../isapc-pci.x86_64-latest.xml | 28 ++++++++++++++++ tests/qemuxmlconfdata/isapc-pci.xml | 13 ++++++++ tests/qemuxmlconftest.c | 2 ++ 4 files changed, 75 insertions(+) create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/isapc-pci.xml diff --git a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args new file mode 100644 index 0000000000..f1d443a0cc --- /dev/null +++ b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine isapc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu 486 \ +-m size=2097152k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-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 \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x1"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml new file mode 100644 index 0000000000..d4c04045dc --- /dev/null +++ b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml @@ -0,0 +1,28 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='isapc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>486</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/isapc-pci.xml b/tests/qemuxmlconfdata/isapc-pci.xml new file mode 100644 index 0000000000..a31cc54b67 --- /dev/null +++ b/tests/qemuxmlconfdata/isapc-pci.xml @@ -0,0 +1,13 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='isapc'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='pci' model='pci-root' index='0'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 26afdf7a7e..e2f7d3dc83 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1295,6 +1295,8 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("no-memory"); + DO_TEST_CAPS_LATEST("isapc-pci"); + DO_TEST_CAPS_LATEST("genid"); DO_TEST_CAPS_LATEST("genid-auto"); -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:16 +0200, Andrea Bolognani via Devel wrote:
The isapc machine type doesn't support PCI, so attempting to add a PCI controller should fail. It currently doesn't, and we're going to address that in an upcoming commit.
Note that the domain gets a PCI memballoon device added automatically. That also shouldn't happen, and will similarly be fixed.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../isapc-pci.x86_64-latest.args | 32 +++++++++++++++++++ .../isapc-pci.x86_64-latest.xml | 28 ++++++++++++++++ tests/qemuxmlconfdata/isapc-pci.xml | 13 ++++++++ tests/qemuxmlconftest.c | 2 ++ 4 files changed, 75 insertions(+) create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/isapc-pci.xml
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Tue, Aug 19, 2025 at 18:22:16 +0200, Andrea Bolognani via Devel wrote:
The isapc machine type doesn't support PCI, so attempting to add a PCI controller should fail. It currently doesn't, and we're going to address that in an upcoming commit.
Note that the domain gets a PCI memballoon device added automatically. That also shouldn't happen, and will similarly be fixed.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../isapc-pci.x86_64-latest.args | 32 +++++++++++++++++++ .../isapc-pci.x86_64-latest.xml | 28 ++++++++++++++++ tests/qemuxmlconfdata/isapc-pci.xml | 13 ++++++++ tests/qemuxmlconftest.c | 2 ++ 4 files changed, 75 insertions(+) create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/isapc-pci.xml
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

The isapc machine type doesn't support PCI, so adding a memballoon (which is a PCI device) to it doesn't make sense. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 3 +-- tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args | 1 - tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 3c481ead5e..ab39dfe138 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1252,12 +1252,11 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, switch (def->os.arch) { case VIR_ARCH_I686: case VIR_ARCH_X86_64: - addDefaultMemballoon = true; - if (STREQ(def->os.machine, "isapc")) { break; } + addDefaultMemballoon = true; addDefaultUSB = true; if (qemuDomainIsQ35(def)) { diff --git a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args index f1d443a0cc..789b7de0ed 100644 --- a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args +++ b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args @@ -27,6 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -no-shutdown \ -boot strict=on \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x1"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml index d4c04045dc..a32f3243d5 100644 --- a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml @@ -21,8 +21,5 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </memballoon> </devices> </domain> -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:17 +0200, Andrea Bolognani via Devel wrote:
The isapc machine type doesn't support PCI, so adding a memballoon (which is a PCI device) to it doesn't make sense.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 3 +-- tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args | 1 - tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

This centralizes the knowledge about which network interface models are PCI devices and thus need to have a PCI address allocated by libvirt, and expands said knowledge to include the fact that models such as spapr-vlan and smc91c111 are not PCI devices. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain_address.c | 62 +++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 96a9ca9b14..07d6366b1b 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -499,6 +499,58 @@ qemuDomainDeviceCalculatePCIAddressExtensionFlags(virQEMUCaps *qemuCaps, } +static bool +qemuDomainNetIsPCI(const virDomainNetDef *net) +{ + switch ((virDomainNetModelType)net->model) { + case VIR_DOMAIN_NET_MODEL_USB_NET: + case VIR_DOMAIN_NET_MODEL_SPAPR_VLAN: + case VIR_DOMAIN_NET_MODEL_LAN9118: + case VIR_DOMAIN_NET_MODEL_SMC91C111: + /* The model above are not PCI devices */ + return false; + + case VIR_DOMAIN_NET_MODEL_RTL8139: + case VIR_DOMAIN_NET_MODEL_VIRTIO: + case VIR_DOMAIN_NET_MODEL_E1000: + case VIR_DOMAIN_NET_MODEL_E1000E: + case VIR_DOMAIN_NET_MODEL_IGB: + case VIR_DOMAIN_NET_MODEL_VIRTIO_TRANSITIONAL: + case VIR_DOMAIN_NET_MODEL_VIRTIO_NON_TRANSITIONAL: + case VIR_DOMAIN_NET_MODEL_VMXNET3: + /* The models above are PCI devices */ + return true; + + case VIR_DOMAIN_NET_MODEL_NETFRONT: + case VIR_DOMAIN_NET_MODEL_VMXNET: + case VIR_DOMAIN_NET_MODEL_VMXNET2: + case VIR_DOMAIN_NET_MODEL_VLANCE: + case VIR_DOMAIN_NET_MODEL_AM79C970A: + case VIR_DOMAIN_NET_MODEL_AM79C973: + case VIR_DOMAIN_NET_MODEL_82540EM: + case VIR_DOMAIN_NET_MODEL_82545EM: + case VIR_DOMAIN_NET_MODEL_82543GC: + case VIR_DOMAIN_NET_MODEL_UNKNOWN: + /* The models above are probably not PCI devices, and in fact + * some of them are not even relevant to the QEMU driver, but + * historically we've defaulted to considering all network + * interfaces to be PCI so we preserve that behavior here */ + return true; + + case VIR_DOMAIN_NET_MODEL_LAST: + default: + virReportEnumRangeError(virDomainNetModelType, net->model); + return false; + } + + /* Due to historical reasons, model names for network interfaces + * are not validated as strictly as other devices. When in doubt, + * assume that network interfaces are PCI devices, as that has + * the highest chance of working correctly */ + return true; +} + + /** * qemuDomainDeviceCalculatePCIConnectFlags: * @@ -669,10 +721,11 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev, * address is assigned when we're assigning the * addresses for other hostdev devices. */ - if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV || - net->model == VIR_DOMAIN_NET_MODEL_USB_NET) { + if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) + return 0; + + if (!qemuDomainNetIsPCI(net)) return 0; - } if (net->model == VIR_DOMAIN_NET_MODEL_VIRTIO || net->model == VIR_DOMAIN_NET_MODEL_VIRTIO_NON_TRANSITIONAL) @@ -2110,9 +2163,8 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, for (i = 0; i < def->nnets; i++) { virDomainNetDef *net = def->nets[i]; - if (net->model == VIR_DOMAIN_NET_MODEL_USB_NET) { + if (!qemuDomainNetIsPCI(net)) continue; - } /* type='hostdev' network devices might be USB, and are also * in hostdevs list anyway, so handle them with other hostdevs -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:18 +0200, Andrea Bolognani via Devel wrote:
This centralizes the knowledge about which network interface models are PCI devices and thus need to have a PCI address allocated by libvirt, and expands said knowledge to include the fact that models such as spapr-vlan and smc91c111 are not PCI devices.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain_address.c | 62 +++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 96a9ca9b14..07d6366b1b 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -499,6 +499,58 @@ qemuDomainDeviceCalculatePCIAddressExtensionFlags(virQEMUCaps *qemuCaps, }
+static bool +qemuDomainNetIsPCI(const virDomainNetDef *net) +{ + switch ((virDomainNetModelType)net->model) { + case VIR_DOMAIN_NET_MODEL_USB_NET: + case VIR_DOMAIN_NET_MODEL_SPAPR_VLAN: + case VIR_DOMAIN_NET_MODEL_LAN9118: + case VIR_DOMAIN_NET_MODEL_SMC91C111: + /* The model above are not PCI devices */ + return false;
This returns false and no error ...
+ + case VIR_DOMAIN_NET_MODEL_RTL8139: + case VIR_DOMAIN_NET_MODEL_VIRTIO: + case VIR_DOMAIN_NET_MODEL_E1000: + case VIR_DOMAIN_NET_MODEL_E1000E: + case VIR_DOMAIN_NET_MODEL_IGB: + case VIR_DOMAIN_NET_MODEL_VIRTIO_TRANSITIONAL: + case VIR_DOMAIN_NET_MODEL_VIRTIO_NON_TRANSITIONAL: + case VIR_DOMAIN_NET_MODEL_VMXNET3: + /* The models above are PCI devices */ + return true; + + case VIR_DOMAIN_NET_MODEL_NETFRONT: + case VIR_DOMAIN_NET_MODEL_VMXNET: + case VIR_DOMAIN_NET_MODEL_VMXNET2: + case VIR_DOMAIN_NET_MODEL_VLANCE: + case VIR_DOMAIN_NET_MODEL_AM79C970A: + case VIR_DOMAIN_NET_MODEL_AM79C973: + case VIR_DOMAIN_NET_MODEL_82540EM: + case VIR_DOMAIN_NET_MODEL_82545EM: + case VIR_DOMAIN_NET_MODEL_82543GC: + case VIR_DOMAIN_NET_MODEL_UNKNOWN: + /* The models above are probably not PCI devices, and in fact + * some of them are not even relevant to the QEMU driver, but + * historically we've defaulted to considering all network + * interfaces to be PCI so we preserve that behavior here */ + return true; + + case VIR_DOMAIN_NET_MODEL_LAST: + default: + virReportEnumRangeError(virDomainNetModelType, net->model); + return false;
And this returns false and raises an error. The caller can't know whether there is an error to raise or not.
+ } + + /* Due to historical reasons, model names for network interfaces + * are not validated as strictly as other devices. When in doubt, + * assume that network interfaces are PCI devices, as that has + * the highest chance of working correctly */ + return true;
Also this is dead code based on the fact that you have 'default' above.
+} + + /** * qemuDomainDeviceCalculatePCIConnectFlags: * @@ -669,10 +721,11 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev, * address is assigned when we're assigning the * addresses for other hostdev devices. */ - if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV || - net->model == VIR_DOMAIN_NET_MODEL_USB_NET) { + if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) + return 0; + + if (!qemuDomainNetIsPCI(net)) return 0; - }
if (net->model == VIR_DOMAIN_NET_MODEL_VIRTIO || net->model == VIR_DOMAIN_NET_MODEL_VIRTIO_NON_TRANSITIONAL) @@ -2110,9 +2163,8 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, for (i = 0; i < def->nnets; i++) { virDomainNetDef *net = def->nets[i];
- if (net->model == VIR_DOMAIN_NET_MODEL_USB_NET) { + if (!qemuDomainNetIsPCI(net)) continue; - }
/* type='hostdev' network devices might be USB, and are also * in hostdevs list anyway, so handle them with other hostdevs
This part looks reasonable but as you can see callers ignore the error raised by virReportEnumRangeError. I suggest you remove the error reported and also merge the 'default' case with the return at the end of the function with the comment explaining why you return true. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

At the moment, we check whether the machine type supports PCI before attempting to allocate PCI addresses, and if it does not, we simply skip the step entirely. This means that an attempt to use a PCI device with a machine type that has no PCI support won't be rejected by libvirt, and only once the QEMU process is started the problem will be made apparent. Validate things ahead of time instead, rejecting any such configurations. Note that we only do this for new domains, because otherwise existing domains that are configured incorrectly would disappear and we generally try really hard to avoid that. A few tests start failing after this change, demonstrating that things are now working as desired. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain_address.c | 18 ++++++++--- ...default-fallback-nousb.aarch64-latest.args | 32 ------------------- ...-default-fallback-nousb.aarch64-latest.xml | 22 ------------- .../usb-controller-default-fallback-nousb.xml | 1 - ...efault-nousb.aarch64-latest.abi-update.err | 1 + ...ntroller-default-nousb.aarch64-latest.args | 32 ------------------- ...ontroller-default-nousb.aarch64-latest.err | 1 + ...fault-unavailable-nousb.aarch64-latest.err | 1 - ...fault-unavailable-nousb.aarch64-latest.xml | 22 ------------- ...b-controller-default-unavailable-nousb.xml | 1 - tests/qemuxmlconftest.c | 14 ++------ 11 files changed, 17 insertions(+), 128 deletions(-) delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 07d6366b1b..312ed52bbd 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2675,7 +2675,8 @@ static int qemuDomainAssignPCIAddresses(virDomainDef *def, virQEMUCaps *qemuCaps, virQEMUDriver *driver, - virDomainObj *obj) + virDomainObj *obj, + bool newDomain) { int ret = -1; virDomainPCIAddressSet *addrs = NULL; @@ -2843,10 +2844,17 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, g_clear_pointer(&addrs, virDomainPCIAddressSetFree); } - if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) - goto cleanup; + /* We're done collecting available information, now we're going + * to allocate PCI addresses for real. We normally skip this part + * for machine type that don't support PCI, but we run it for new + * domains to catch situation in which the user is incorrectly + * asking for PCI devices to be used. If that's the case, an + * error will naturally be raised when attempting to allocate a + * PCI address since no PCI buses exist */ + if (qemuDomainSupportsPCI(def) || newDomain) { + if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) + goto cleanup; - if (qemuDomainSupportsPCI(def)) { if (qemuDomainValidateDevicePCISlotsChipsets(def, addrs) < 0) goto cleanup; @@ -3290,7 +3298,7 @@ qemuDomainAssignAddresses(virDomainDef *def, qemuDomainAssignVirtioMMIOAddresses(def, qemuCaps); - if (qemuDomainAssignPCIAddresses(def, qemuCaps, driver, obj) < 0) + if (qemuDomainAssignPCIAddresses(def, qemuCaps, driver, obj, newDomain) < 0) return -1; if (qemuDomainAssignUSBAddresses(def, obj, newDomain) < 0) diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args deleted file mode 100644 index 0fb2909dd2..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine collie,usb=off,dump-guest-core=off,memory-backend=strongarm.sdram \ --accel kvm \ --cpu host \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"strongarm.sdram","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 \ --device '{"driver":"qemu-xhci","id":"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-fallback-nousb.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml deleted file mode 100644 index fa258c5671..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml +++ /dev/null @@ -1,22 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='collie'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='qemu-xhci'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml deleted file mode 120000 index 9cba7c3a06..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml +++ /dev/null @@ -1 +0,0 @@ -usb-controller-default-nousb.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err new file mode 100644 index 0000000000..a0ca4fba5d --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err @@ -0,0 +1 @@ +XML error: No PCI buses available diff --git a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args deleted file mode 100644 index 0fb2909dd2..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args +++ /dev/null @@ -1,32 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine collie,usb=off,dump-guest-core=off,memory-backend=strongarm.sdram \ --accel kvm \ --cpu host \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"strongarm.sdram","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 \ --device '{"driver":"qemu-xhci","id":"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-nousb.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err new file mode 100644 index 0000000000..a0ca4fba5d --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err @@ -0,0 +1 @@ +XML error: No PCI buses available diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err deleted file mode 100644 index cac4e8e760..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err +++ /dev/null @@ -1 +0,0 @@ -internal error: Unable to determine model for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml deleted file mode 100644 index ac5f270a3a..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml +++ /dev/null @@ -1,22 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='collie'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml deleted file mode 120000 index 9cba7c3a06..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml +++ /dev/null @@ -1 +0,0 @@ -usb-controller-default-nousb.xml \ No newline at end of file diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index e2f7d3dc83..b3e1e37abb 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2064,18 +2064,8 @@ mymain(void) ARG_END); /* The '-nousb' test case tests machine without a built-in USB controller */ - DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-nousb", "aarch64"); - DO_TEST_FULL("usb-controller-default-fallback-nousb", ".aarch64-latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, - ARG_END); - DO_TEST_FULL("usb-controller-default-unavailable-nousb", ".aarch64-latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, - ARG_END); + DO_TEST_CAPS_ARCH_LATEST_FAILURE("usb-controller-default-nousb", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR("usb-controller-default-nousb", "aarch64"); DO_TEST_FULL("usb-controller-default-fallback-g3beige", ".ppc64-latest", ARG_CAPS_ARCH, "ppc64", -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:19 +0200, Andrea Bolognani via Devel wrote:
At the moment, we check whether the machine type supports PCI before attempting to allocate PCI addresses, and if it does not, we simply skip the step entirely.
This means that an attempt to use a PCI device with a machine type that has no PCI support won't be rejected by libvirt, and only once the QEMU process is started the problem will be made apparent.
Validate things ahead of time instead, rejecting any such configurations.
Note that we only do this for new domains, because otherwise existing domains that are configured incorrectly would disappear and we generally try really hard to avoid that.
A few tests start failing after this change, demonstrating that things are now working as desired.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain_address.c | 18 ++++++++--- ...default-fallback-nousb.aarch64-latest.args | 32 ------------------- ...-default-fallback-nousb.aarch64-latest.xml | 22 ------------- .../usb-controller-default-fallback-nousb.xml | 1 - ...efault-nousb.aarch64-latest.abi-update.err | 1 + ...ntroller-default-nousb.aarch64-latest.args | 32 ------------------- ...ontroller-default-nousb.aarch64-latest.err | 1 + ...fault-unavailable-nousb.aarch64-latest.err | 1 - ...fault-unavailable-nousb.aarch64-latest.xml | 22 ------------- ...b-controller-default-unavailable-nousb.xml | 1 - tests/qemuxmlconftest.c | 14 ++------ 11 files changed, 17 insertions(+), 128 deletions(-) delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 07d6366b1b..312ed52bbd 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2675,7 +2675,8 @@ static int qemuDomainAssignPCIAddresses(virDomainDef *def, virQEMUCaps *qemuCaps, virQEMUDriver *driver, - virDomainObj *obj) + virDomainObj *obj, + bool newDomain) { int ret = -1; virDomainPCIAddressSet *addrs = NULL; @@ -2843,10 +2844,17 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, g_clear_pointer(&addrs, virDomainPCIAddressSetFree); }
- if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) - goto cleanup; + /* We're done collecting available information, now we're going + * to allocate PCI addresses for real. We normally skip this part + * for machine type that don't support PCI, but we run it for new + * domains to catch situation in which the user is incorrectly + * asking for PCI devices to be used. If that's the case, an + * error will naturally be raised when attempting to allocate a + * PCI address since no PCI buses exist */ + if (qemuDomainSupportsPCI(def) || newDomain) { + if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) + goto cleanup;
Any reason why this is here and not in e.g qemuValidateDomainDef() which based on the description seems like the proper place?
- if (qemuDomainSupportsPCI(def)) { if (qemuDomainValidateDevicePCISlotsChipsets(def, addrs) < 0) goto cleanup;
--- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err @@ -0,0 +1 @@ +XML error: No PCI buses available
At this point it's IMO borderline whether it's a XML error or not. It's a configuration error but some configurations which don't mention PCI do get it normally. Although this is pre-existing and cosmetic.

On Thu, Sep 18, 2025 at 02:53:00PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:19 +0200, Andrea Bolognani via Devel wrote:
@@ -2843,10 +2844,17 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, g_clear_pointer(&addrs, virDomainPCIAddressSetFree); }
- if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) - goto cleanup; + /* We're done collecting available information, now we're going + * to allocate PCI addresses for real. We normally skip this part + * for machine type that don't support PCI, but we run it for new + * domains to catch situation in which the user is incorrectly + * asking for PCI devices to be used. If that's the case, an + * error will naturally be raised when attempting to allocate a + * PCI address since no PCI buses exist */ + if (qemuDomainSupportsPCI(def) || newDomain) { + if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) + goto cleanup;
Any reason why this is here and not in e.g qemuValidateDomainDef() which based on the description seems like the proper place?
Basically the way we perform address allocation and device validation makes this incredibly tricky to put anywhere else. Ideally you'd just interate over all PCI devices at validate time and, if any exists but the machine type doesn't support PCI, you'd report an error. However the single source of truth for whether or not a device is PCI are the virDomainPCIConnectFlags that get assigned to it. We don't want to duplicate that information elsewhere. Plus the fact that virtio devices exist make things even more complicated. Is virtio-blk a PCI device? Well, yes. Unless you are on Arm/RISC-V and you explicitly asked for it not to be by assigning a virtio-mmio address to it. Or you're on s390x :) Putting this check here means that the problematic scenarios are naturally filtered out as part of the PCI address allocation process, with no code duplication or possibility of something falling through the cracks.
+++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err @@ -0,0 +1 @@ +XML error: No PCI buses available
At this point it's IMO borderline whether it's a XML error or not. It's a configuration error but some configurations which don't mention PCI do get it normally.
Although this is pre-existing and cosmetic.
The error is not necessarily great but you will only hit it when attempting to do something genuinely invalid and PCI-related, such as adding a USB or PCI controller to a machine that doesn't support PCI. -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Sep 19, 2025 at 08:21:50 -0500, Andrea Bolognani wrote:
On Thu, Sep 18, 2025 at 02:53:00PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:19 +0200, Andrea Bolognani via Devel wrote:
@@ -2843,10 +2844,17 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, g_clear_pointer(&addrs, virDomainPCIAddressSetFree); }
- if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) - goto cleanup; + /* We're done collecting available information, now we're going + * to allocate PCI addresses for real. We normally skip this part + * for machine type that don't support PCI, but we run it for new + * domains to catch situation in which the user is incorrectly + * asking for PCI devices to be used. If that's the case, an + * error will naturally be raised when attempting to allocate a + * PCI address since no PCI buses exist */ + if (qemuDomainSupportsPCI(def) || newDomain) { + if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) + goto cleanup;
Any reason why this is here and not in e.g qemuValidateDomainDef() which based on the description seems like the proper place?
Basically the way we perform address allocation and device validation makes this incredibly tricky to put anywhere else.
Ideally you'd just interate over all PCI devices at validate time and, if any exists but the machine type doesn't support PCI, you'd report an error.
However the single source of truth for whether or not a device is PCI are the virDomainPCIConnectFlags that get assigned to it. We don't want to duplicate that information elsewhere.
Plus the fact that virtio devices exist make things even more complicated. Is virtio-blk a PCI device? Well, yes. Unless you are on Arm/RISC-V and you explicitly asked for it not to be by assigning a virtio-mmio address to it. Or you're on s390x :)
Putting this check here means that the problematic scenarios are naturally filtered out as part of the PCI address allocation process, with no code duplication or possibility of something falling through the cracks.
I wanted to complain that there actually are multiple places that still need fixing, namely hotplug, as that allocates addresses in a different way (for each device individually). But looking a bit deeper it results in the same code being called. I still think that validation ought to be together with validation but your explanation makes sense.
+++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err @@ -0,0 +1 @@ +XML error: No PCI buses available
At this point it's IMO borderline whether it's a XML error or not. It's a configuration error but some configurations which don't mention PCI do get it normally.
Although this is pre-existing and cosmetic.
The error is not necessarily great but you will only hit it when attempting to do something genuinely invalid and PCI-related, such as adding a USB or PCI controller to a machine that doesn't support PCI.
-- Andrea Bolognani / Red Hat / Virtualization

The qemuValidateDomainDeviceDefControllerPCI() function is called if PCI controllers are present in the domain configuration, which shouldn't happen if the machine type doesn't support PCI. If we somehow find ourselves in that scenario, reporting an error would be the right thing to do. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_validate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index adba3e4a89..ebcc9b8e8e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3975,6 +3975,13 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, return -1; } + if (!qemuDomainSupportsPCI(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Machine type '%1$s' does not support PCI"), + def->os.machine); + return -1; + } + /* modelName */ switch ((virDomainControllerModelPCI) cont->model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:20 +0200, Andrea Bolognani via Devel wrote:
The qemuValidateDomainDeviceDefControllerPCI() function is called if PCI controllers are present in the domain configuration, which shouldn't happen if the machine type doesn't support PCI. If we somehow find ourselves in that scenario, reporting an error would be the right thing to do.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_validate.c | 7 +++++++ 1 file changed, 7 insertions(+)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

The sparc architecture doesn't support PCI, and neither does the isapc machine type. One of the isapc tests starts failing as a consequence of this change, which is expected; somewhat surprisingly, another test for the same machine type goes from an early/hard failure (PARSE_ERROR) to a late/soft one (FAILURE) instead. This will be rectified by a later commit. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 10 ++++++ .../isapc-pci.x86_64-latest.args | 31 ------------------- .../isapc-pci.x86_64-latest.err | 1 + ...ontroller-default-isapc.x86_64-latest.xml} | 5 +-- tests/qemuxmlconftest.c | 4 +-- 5 files changed, 16 insertions(+), 35 deletions(-) delete mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.err rename tests/qemuxmlconfdata/{isapc-pci.x86_64-latest.xml => usb-controller-default-isapc.x86_64-latest.xml} (86%) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 81a8ca906d..186e36da03 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7703,6 +7703,16 @@ qemuDomainSupportsPCI(const virDomainDef *def) return false; } + if (ARCH_IS_X86(def->os.arch)) { + if (STREQ(def->os.machine, "isapc")) { + return false; + } + return true; + } + + if (def->os.arch == VIR_ARCH_SPARC) + return false; + /* On all other architectures, PCI support is assumed to * be present */ return true; diff --git a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args deleted file mode 100644 index 789b7de0ed..0000000000 --- a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args +++ /dev/null @@ -1,31 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -/usr/bin/qemu-system-x86_64 \ --name guest=test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ --machine isapc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ --accel tcg \ --cpu 486 \ --m size=2097152k \ --object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":2147483648}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ --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 \ --audiodev '{"id":"audio1","driver":"none"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.err b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.err new file mode 100644 index 0000000000..0a45494ea2 --- /dev/null +++ b/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.err @@ -0,0 +1 @@ +unsupported configuration: Machine type 'isapc' does not support PCI diff --git a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.xml similarity index 86% rename from tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml rename to tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.xml index a32f3243d5..c18e2b1b0d 100644 --- a/tests/qemuxmlconfdata/isapc-pci.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.xml @@ -1,5 +1,5 @@ <domain type='qemu'> - <name>test</name> + <name>q35-test</name> <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> @@ -17,9 +17,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='pci' index='0' model='pci-root'/> + <controller type='usb' index='0' model='piix3-uhci'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> + <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index b3e1e37abb..9653dcc7df 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1295,7 +1295,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("no-memory"); - DO_TEST_CAPS_LATEST("isapc-pci"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("isapc-pci"); DO_TEST_CAPS_LATEST("genid"); DO_TEST_CAPS_LATEST("genid-auto"); @@ -1971,7 +1971,7 @@ mymain(void) ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); - DO_TEST_CAPS_LATEST_PARSE_ERROR("usb-controller-default-isapc"); + DO_TEST_CAPS_LATEST_FAILURE("usb-controller-default-isapc"); DO_TEST_CAPS_LATEST("usb-controller-default-i440fx"); DO_TEST_CAPS_LATEST("usb-controller-default-q35"); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-pseries", "ppc64"); -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:21 +0200, Andrea Bolognani via Devel wrote:
The sparc architecture doesn't support PCI, and neither does the isapc machine type.
You're mixing architectures with machines :P (spell out the arch for isapc)
One of the isapc tests starts failing as a consequence of this change, which is expected; somewhat surprisingly, another test for the same machine type goes from an early/hard failure (PARSE_ERROR) to a late/soft one (FAILURE) instead. This will be rectified by a later commit.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 10 ++++++ .../isapc-pci.x86_64-latest.args | 31 ------------------- .../isapc-pci.x86_64-latest.err | 1 + ...ontroller-default-isapc.x86_64-latest.xml} | 5 +-- tests/qemuxmlconftest.c | 4 +-- 5 files changed, 16 insertions(+), 35 deletions(-) delete mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/isapc-pci.x86_64-latest.err rename tests/qemuxmlconfdata/{isapc-pci.x86_64-latest.xml => usb-controller-default-isapc.x86_64-latest.xml} (86%)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

These checks enforce some expectations that were, until now, documented solely through comments or not spelled out at all. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index ab39dfe138..e2004993f3 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1383,6 +1383,41 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, break; } + /* Sanity check. If the machine type does not support PCI, asking + * for PCI(e) root to be added is an obvious mistake */ + if ((addPCIRoot || + addPCIeRoot) && + !qemuDomainSupportsPCI(def)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' wants PCI but PCI is not supported"), + def->os.machine); + return -1; + } + + /* Sanity check. If the machine type supports PCI, we need to reflect + * that fact in the XML or other parts of the machine handling code + * might misbehave */ + if (qemuDomainSupportsPCI(def) && + !addPCIRoot && + !addPCIeRoot) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' supports PCI but no PCI controller added"), + def->os.machine); + return -1; + } + + /* Sanity check. USB controllers are PCI devices, so asking for a + * USB controller to be added but not for a PCI(e) root to be + * added at the same time is likely an oversight */ + if (addDefaultUSB && + !addPCIRoot && + !addPCIeRoot) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' wants USB but no PCI controller added"), + def->os.machine); + return -1; + } + if (addDefaultUSB && virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_USB, 0) < 0) virDomainDefAddUSBController(def, 0, usbModel); @@ -1391,9 +1426,6 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, pciRoot = virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0); - /* NB: any machine that sets addPCIRoot to true must also return - * true from the function qemuDomainSupportsPCI(). - */ if (addPCIRoot) { if (pciRoot >= 0) { if (def->controllers[pciRoot]->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:22 +0200, Andrea Bolognani via Devel wrote:
These checks enforce some expectations that were, until now, documented solely through comments or not spelled out at all.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index ab39dfe138..e2004993f3 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1383,6 +1383,41 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, break; }
+ /* Sanity check. If the machine type does not support PCI, asking + * for PCI(e) root to be added is an obvious mistake */ + if ((addPCIRoot || + addPCIeRoot) && + !qemuDomainSupportsPCI(def)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' wants PCI but PCI is not supported"), + def->os.machine); + return -1; + }
I agree with this one.
+ + /* Sanity check. If the machine type supports PCI, we need to reflect + * that fact in the XML or other parts of the machine handling code + * might misbehave */
This one is a bit borderline. IMO you can have machine with no default PCI but the possibility to explicily add such a bus.
+ if (qemuDomainSupportsPCI(def) && + !addPCIRoot && + !addPCIeRoot) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' supports PCI but no PCI controller added"), + def->os.machine); + return -1; + } + + /* Sanity check. USB controllers are PCI devices, so asking for a + * USB controller to be added but not for a PCI(e) root to be + * added at the same time is likely an oversight */
I'm fairly sure there are non-PCI USB controllers so this one is definitely false. It's just that libvirt supports only USB controllers which are on PCI. IMO this assumption should be validated with the USB controller itself.
+ if (addDefaultUSB && + !addPCIRoot && + !addPCIeRoot) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' wants USB but no PCI controller added"), + def->os.machine); + return -1; + } + if (addDefaultUSB && virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_USB, 0) < 0) virDomainDefAddUSBController(def, 0, usbModel);
@@ -1391,9 +1426,6 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
pciRoot = virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0);
- /* NB: any machine that sets addPCIRoot to true must also return - * true from the function qemuDomainSupportsPCI(). - */ if (addPCIRoot) { if (pciRoot >= 0) { if (def->controllers[pciRoot]->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { -- 2.50.1

On Thu, Sep 18, 2025 at 03:04:28PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:22 +0200, Andrea Bolognani via Devel wrote:
+ /* Sanity check. If the machine type supports PCI, we need to reflect + * that fact in the XML or other parts of the machine handling code + * might misbehave */
This one is a bit borderline. IMO you can have machine with no default PCI but the possibility to explicily add such a bus.
Can you point to a specific example? I'm not aware of any. To the best of my knowledge, all machines that are PCI-capable come with a root PCI controller out of the gate. There is no QEMU device corresponding to the root PCI controller either, so I don't know how you would even go about adding it if it were opt-in. Perhaps a machine type flag but again, I'm not aware of that actually being a thing.
+ if (qemuDomainSupportsPCI(def) && + !addPCIRoot && + !addPCIeRoot) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' supports PCI but no PCI controller added"), + def->os.machine); + return -1; + } + + /* Sanity check. USB controllers are PCI devices, so asking for a + * USB controller to be added but not for a PCI(e) root to be + * added at the same time is likely an oversight */
I'm fairly sure there are non-PCI USB controllers so this one is definitely false. It's just that libvirt supports only USB controllers which are on PCI.
IMO this assumption should be validated with the USB controller itself.
I'm not aware of any non-PCI USB controller out there, certainly not in QEMU. Can you point to one? -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Sep 19, 2025 at 08:28:38 -0500, Andrea Bolognani wrote:
On Thu, Sep 18, 2025 at 03:04:28PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:22 +0200, Andrea Bolognani via Devel wrote:
+ /* Sanity check. If the machine type supports PCI, we need to reflect + * that fact in the XML or other parts of the machine handling code + * might misbehave */
This one is a bit borderline. IMO you can have machine with no default PCI but the possibility to explicily add such a bus.
Can you point to a specific example? I'm not aware of any.
I don't have a specific example for this, but I have a example where the sanity check breaks loading config of one of VMs I had defined before: <domain type='kvm'> <name>microvm</name> <uuid>e739ac15-61b5-48c2-acc8-e7fb2b79774f</uuid> <memory unit='KiB'>1024000</memory> <currentMemory unit='KiB'>1024000</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='microvm'>hvm</type> <boot dev='hd'/> </os> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>qemu64</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/alpine.qcow2'/> <target dev='vda' bus='virtio'/> <address type='virtio-mmio'/> </disk> <controller type='usb' index='0' model='none'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> </domain> ... will after this patch be rejected at load time: 2025-09-19 14:16:28.132+0000: 214862: info : virDomainObjListLoadAllConfigs:601 : Loading config file 'microvm.xml' 2025-09-19 14:16:28.132+0000: 214862: debug : virDomainControllerDefParseXML:9008 : Ignoring device address for none model usb controller 2025-09-19 14:16:28.132+0000: 214862: debug : virDomainMemballoonDefParseXML:12948 : Ignoring device address for none model Memballoon 2025-09-19 14:16:28.132+0000: 214862: debug : virCPUDataIsIdentical:1285 : a=0x7fffac30c7f0, b=0x7fffac523430 2025-09-19 14:16:28.132+0000: 214862: debug : virArchFromHost:236 : Mapped x86_64 to 35 (x86_64) 2025-09-19 14:16:28.132+0000: 214862: debug : virQEMUCapsCacheLookup:5996 : Returning caps 0x7fffac022ad0 for /usr/bin/qemu-system-x86_64 2025-09-19 14:16:28.132+0000: 214862: error : qemuDomainDefAddDefaultDevices:1343 : internal error: Machine type 'microvm' supports PCI but no PCI controller added 2025-09-19 14:16:28.132+0000: 214862: error : virDomainObjListLoadAllConfigs:622 : Failed to load config for domain 'microvm'
To the best of my knowledge, all machines that are PCI-capable come with a root PCI controller out of the gate.
There is no QEMU device corresponding to the root PCI controller either, so I don't know how you would even go about adding it if it were opt-in. Perhaps a machine type flag but again, I'm not aware of that actually being a thing.
IIUC 'microvm' doesn't support PCI, which shows that this check itself is broken not that there isn't merit in the check itself.
+ if (qemuDomainSupportsPCI(def) && + !addPCIRoot && + !addPCIeRoot) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Machine type '%1$s' supports PCI but no PCI controller added"), + def->os.machine); + return -1; + } + + /* Sanity check. USB controllers are PCI devices, so asking for a u> > > + * USB controller to be added but not for a PCI(e) root to be + * added at the same time is likely an oversight */
I'm fairly sure there are non-PCI USB controllers so this one is definitely false. It's just that libvirt supports only USB controllers which are on PCI.
IMO this assumption should be validated with the USB controller itself.
I'm not aware of any non-PCI USB controller out there, certainly not in QEMU. Can you point to one?
One example is the USB controller in older raspberry-pis, which is embedded in the SoC. I presume it's accessed via MMIO. QEMU claims support for rpis at least. As said this is something that ought to be validated when validating the USB controller device, rather than here.

On Fri, Sep 19, 2025 at 04:28:03PM +0200, Peter Krempa wrote:
On Fri, Sep 19, 2025 at 08:28:38 -0500, Andrea Bolognani wrote:
On Thu, Sep 18, 2025 at 03:04:28PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:22 +0200, Andrea Bolognani via Devel wrote:
+ /* Sanity check. If the machine type supports PCI, we need to reflect + * that fact in the XML or other parts of the machine handling code + * might misbehave */
This one is a bit borderline. IMO you can have machine with no default PCI but the possibility to explicily add such a bus.
Can you point to a specific example? I'm not aware of any.
I don't have a specific example for this, but I have a example where the sanity check breaks loading config of one of VMs I had defined before:
<domain type='kvm'> <name>microvm</name> <uuid>e739ac15-61b5-48c2-acc8-e7fb2b79774f</uuid> <memory unit='KiB'>1024000</memory> <currentMemory unit='KiB'>1024000</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='microvm'>hvm</type> <boot dev='hd'/> </os> <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>qemu64</model> </cpu> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/alpine.qcow2'/> <target dev='vda' bus='virtio'/> <address type='virtio-mmio'/> </disk> <controller type='usb' index='0' model='none'/> <audio id='1' type='none'/> <memballoon model='none'/> </devices> </domain>
... will after this patch be rejected at load time:
2025-09-19 14:16:28.132+0000: 214862: info : virDomainObjListLoadAllConfigs:601 : Loading config file 'microvm.xml' 2025-09-19 14:16:28.132+0000: 214862: debug : virDomainControllerDefParseXML:9008 : Ignoring device address for none model usb controller 2025-09-19 14:16:28.132+0000: 214862: debug : virDomainMemballoonDefParseXML:12948 : Ignoring device address for none model Memballoon 2025-09-19 14:16:28.132+0000: 214862: debug : virCPUDataIsIdentical:1285 : a=0x7fffac30c7f0, b=0x7fffac523430 2025-09-19 14:16:28.132+0000: 214862: debug : virArchFromHost:236 : Mapped x86_64 to 35 (x86_64) 2025-09-19 14:16:28.132+0000: 214862: debug : virQEMUCapsCacheLookup:5996 : Returning caps 0x7fffac022ad0 for /usr/bin/qemu-system-x86_64 2025-09-19 14:16:28.132+0000: 214862: error : qemuDomainDefAddDefaultDevices:1343 : internal error: Machine type 'microvm' supports PCI but no PCI controller added 2025-09-19 14:16:28.132+0000: 214862: error : virDomainObjListLoadAllConfigs:622 : Failed to load config for domain 'microvm'
To the best of my knowledge, all machines that are PCI-capable come with a root PCI controller out of the gate.
There is no QEMU device corresponding to the root PCI controller either, so I don't know how you would even go about adding it if it were opt-in. Perhaps a machine type flag but again, I'm not aware of that actually being a thing.
IIUC 'microvm' doesn't support PCI, which shows that this check itself is broken not that there isn't merit in the check itself.
Yup, qemuDomainSupportsPCI() needs to be tweaked further to account for this.
+ /* Sanity check. USB controllers are PCI devices, so asking for a + * USB controller to be added but not for a PCI(e) root to be + * added at the same time is likely an oversight */
I'm fairly sure there are non-PCI USB controllers so this one is definitely false. It's just that libvirt supports only USB controllers which are on PCI.
IMO this assumption should be validated with the USB controller itself.
I'm not aware of any non-PCI USB controller out there, certainly not in QEMU. Can you point to one?
One example is the USB controller in older raspberry-pis, which is embedded in the SoC. I presume it's accessed via MMIO. QEMU claims support for rpis at least.
As said this is something that ought to be validated when validating the USB controller device, rather than here.
Oh yeah, here it is: dev: dwc2-usb, id "" gpio-out "sysbus-irq" 1 usb_version = 2 (0x2) mmio ffffffffffffffff/0000000000011000 bus: usb-bus.0 type usb-bus Point taken, this check is incorrect. -- Andrea Bolognani / Red Hat / Virtualization

If we have gotten this far into creating the QEMU command line, either the user or some earlier code should have assigned a PCI address to the USB controller. If one is not present, that must mean there's a bug somewhere. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e8de386f30..f5a80f6955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2598,6 +2598,13 @@ qemuValidateDomainDeviceDefControllerUSB(const virDomainControllerDef *def, return -1; } + if (!virDeviceInfoPCIAddressIsPresent(&def->info)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Missing PCI address for USB controller idx=%1$d"), + def->idx); + return -1; + } + if (!virQEMUCapsGet(qemuCaps, qemuControllerModelUSBToCaps(def->model))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("USB controller model '%1$s' not supported in this QEMU binary"), -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:23 +0200, Andrea Bolognani via Devel wrote:
If we have gotten this far into creating the QEMU command line, either the user or some earlier code should have assigned a PCI address to the USB controller. If one is not present, that must mean there's a bug somewhere.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e8de386f30..f5a80f6955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2598,6 +2598,13 @@ qemuValidateDomainDeviceDefControllerUSB(const virDomainControllerDef *def, return -1; }
+ if (!virDeviceInfoPCIAddressIsPresent(&def->info)) { + virReportError(VIR_ERR_INTERNAL_ERROR,
This surely is no internal error.
+ _("Missing PCI address for USB controller idx=%1$d"),
This ought to say something about the USB controller model %s requiring PCI support and PCI address asigned to go with my comments on the previous patch.
+ def->idx); + return -1; + } + if (!virQEMUCapsGet(qemuCaps, qemuControllerModelUSBToCaps(def->model))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("USB controller model '%1$s' not supported in this QEMU binary"), -- 2.50.1

When support for s390x was introduced in libvirt, it naturally followed the conventions established at the time for x86, which were to have a USB controller added by default. Later, in 2013, commit 3a82f628a964 made the default USB controller model for s390x VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE, effectively overriding the architecture-independent default. However, an exception was carved out at the time: if the USB controller had an address assigned to it, then it would be left alone. A couple of years later, commit 09ab9dcc85ec changed things again in two ways: for starters, libvirt would no longer automatically attempt to add a USB controller to newly-defined s390x guests; moreover, the command line generator was changed so that the legacy USB controller (-usb) would never be used on s390x. In other words, unless a model name is explicitly provided for the USB controller, which is something that only actually works when using a recent QEMU version (see commit f9ed4d385ab8), s390x guests will never have USB controllers attached to them. Remove the exception carved out a decade ago and always reflect this fact accurately in the guest XML. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 15 ++++++++++----- .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 5 +---- ...ive-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 5 +---- ...emuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 5 +---- ...live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 5 +---- ...base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 5 +---- .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 5 +---- .../qemuhotplug-base-ccw-live.xml | 5 +---- .../s390-usb-address.s390x-latest.xml | 6 +----- 9 files changed, 18 insertions(+), 38 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index e2004993f3..cbef101104 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -380,11 +380,9 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; if (ARCH_IS_S390(def->os.arch)) { - if (cont->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { - /* set the default USB model to none for s390 unless an - * address is found */ - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; - } + /* No default model on s390x, one has to be provided + * explicitly by the user */ + cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; } else if (ARCH_IS_PPC64(def->os.arch)) { /* To not break migration we need to set default USB controller * for ppc64 to pci-ohci if we cannot change ABI of the VM. @@ -412,6 +410,13 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; } } + + /* Make sure the 'none' USB controller doesn't have an address + * associated with it, as that would trip up later checks and + * it doesn't make sense anyway */ + if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; + /* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr */ if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1 || cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2) { diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml index 6e879ded86..300dea1382 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml @@ -29,11 +29,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml index 9b16951e46..882a509eeb 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml @@ -39,11 +39,8 @@ <alias name='virtio-disk1'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml index b5292a7ed2..6167d54bd2 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml @@ -29,11 +29,8 @@ <alias name='virtio-disk0'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml index f37868101c..67a5c84a6c 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml @@ -38,11 +38,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml index f37868101c..67a5c84a6c 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml @@ -38,11 +38,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml index 42f89a07a2..07bbfa24a2 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml @@ -28,11 +28,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml index f0570b5cf4..4869103a06 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml @@ -19,11 +19,8 @@ <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml b/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml index 595d0b1a1e..e17098a3df 100644 --- a/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml +++ b/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml @@ -17,11 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> - </controller> + <controller type='usb' index='0' model='none'/> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> -- 2.50.1

On 19/08/2025 18.22, Andrea Bolognani via Devel wrote:
When support for s390x was introduced in libvirt, it naturally followed the conventions established at the time for x86, which were to have a USB controller added by default.
Later, in 2013, commit 3a82f628a964 made the default USB controller model for s390x VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE, effectively overriding the architecture-independent default.
However, an exception was carved out at the time: if the USB controller had an address assigned to it, then it would be left alone.
A couple of years later, commit 09ab9dcc85ec changed things again in two ways: for starters, libvirt would no longer automatically attempt to add a USB controller to newly-defined s390x guests; moreover, the command line generator was changed so that the legacy USB controller (-usb) would never be used on s390x.
In other words, unless a model name is explicitly provided for the USB controller, which is something that only actually works when using a recent QEMU version (see commit f9ed4d385ab8), s390x guests will never have USB controllers attached to them.
Remove the exception carved out a decade ago and always reflect this fact accurately in the guest XML.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 15 ++++++++++----- .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 5 +---- ...ive-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 5 +---- ...emuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 5 +---- ...live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 5 +---- ...base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 5 +---- .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 5 +---- .../qemuhotplug-base-ccw-live.xml | 5 +---- .../s390-usb-address.s390x-latest.xml | 6 +----- 9 files changed, 18 insertions(+), 38 deletions(-)
Reviewed-by: Thomas Huth <thuth@redhat.com>

On 8/19/25 18:22, Andrea Bolognani via Devel wrote:
When support for s390x was introduced in libvirt, it naturally followed the conventions established at the time for x86, which were to have a USB controller added by default.
Later, in 2013, commit 3a82f628a964 made the default USB controller model for s390x VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE, effectively overriding the architecture-independent default.
However, an exception was carved out at the time: if the USB controller had an address assigned to it, then it would be left alone.
A couple of years later, commit 09ab9dcc85ec changed things again in two ways: for starters, libvirt would no longer automatically attempt to add a USB controller to newly-defined s390x guests; moreover, the command line generator was changed so that the legacy USB controller (-usb) would never be used on s390x.
In other words, unless a model name is explicitly provided for the USB controller, which is something that only actually works when using a recent QEMU version (see commit f9ed4d385ab8), s390x guests will never have USB controllers attached to them.
Remove the exception carved out a decade ago and always reflect this fact accurately in the guest XML.
Signed-off-by: Andrea Bolognani<abologna@redhat.com> --- src/qemu/qemu_postparse.c | 15 ++++++++++----- .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 5 +---- ...ive-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 5 +---- ...emuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 5 +---- ...live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 5 +---- ...base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 5 +---- .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 5 +---- .../qemuhotplug-base-ccw-live.xml | 5 +---- .../s390-usb-address.s390x-latest.xml | 6 +----- 9 files changed, 18 insertions(+), 38 deletions(-)
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Tue, Aug 19, 2025 at 18:22:24 +0200, Andrea Bolognani via Devel wrote:
When support for s390x was introduced in libvirt, it naturally followed the conventions established at the time for x86, which were to have a USB controller added by default.
Later, in 2013, commit 3a82f628a964 made the default USB controller model for s390x VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE, effectively overriding the architecture-independent default.
However, an exception was carved out at the time: if the USB controller had an address assigned to it, then it would be left alone.
A couple of years later, commit 09ab9dcc85ec changed things again in two ways: for starters, libvirt would no longer automatically attempt to add a USB controller to newly-defined s390x guests; moreover, the command line generator was changed so that the legacy USB controller (-usb) would never be used on s390x.
In other words, unless a model name is explicitly provided for the USB controller, which is something that only actually works when using a recent QEMU version (see commit f9ed4d385ab8), s390x guests will never have USB controllers attached to them.
Remove the exception carved out a decade ago and always reflect this fact accurately in the guest XML.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_postparse.c | 15 ++++++++++----- .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 5 +---- ...ive-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 5 +---- ...emuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 5 +---- ...live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 5 +---- ...base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 5 +---- .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 5 +---- .../qemuhotplug-base-ccw-live.xml | 5 +---- .../s390-usb-address.s390x-latest.xml | 6 +----- 9 files changed, 18 insertions(+), 38 deletions(-)
diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index e2004993f3..cbef101104 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -380,11 +380,9 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI;
if (ARCH_IS_S390(def->os.arch)) { - if (cont->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { - /* set the default USB model to none for s390 unless an - * address is found */ - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; - } + /* No default model on s390x, one has to be provided + * explicitly by the user */ + cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; } else if (ARCH_IS_PPC64(def->os.arch)) { /* To not break migration we need to set default USB controller * for ppc64 to pci-ohci if we cannot change ABI of the VM. @@ -412,6 +410,13 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; } } + + /* Make sure the 'none' USB controller doesn't have an address + * associated with it, as that would trip up later checks and + * it doesn't make sense anyway */ + if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; + /* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr */ if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1 || cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2) { diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml index 6e879ded86..300dea1382 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml @@ -29,11 +29,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
Having alias for a 'none' controller is nonsense.
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml index 9b16951e46..882a509eeb 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml @@ -39,11 +39,8 @@ <alias name='virtio-disk1'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
ditto
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml index b5292a7ed2..6167d54bd2 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml @@ -29,11 +29,8 @@ <alias name='virtio-disk0'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
...
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml index f37868101c..67a5c84a6c 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml @@ -38,11 +38,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
...
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml index f37868101c..67a5c84a6c 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml @@ -38,11 +38,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
...
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml index 42f89a07a2..07bbfa24a2 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml @@ -28,11 +28,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
...
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml index f0570b5cf4..4869103a06 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml @@ -19,11 +19,8 @@ <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
...
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> </controller> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> diff --git a/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml b/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml index 595d0b1a1e..e17098a3df 100644 --- a/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml +++ b/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml @@ -17,11 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'> - <zpci uid='0x0001' fid='0x00000000'/> - </address> - </controller> + <controller type='usb' index='0' model='none'/> <controller type='pci' index='0' model='pci-root'/> <audio id='1' type='none'/> <memballoon model='none'/> -- 2.50.1
With the above addressed: Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Thu, Sep 18, 2025 at 03:15:25PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:24 +0200, Andrea Bolognani via Devel wrote:
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml @@ -29,11 +29,8 @@ <alias name='virtio-disk4'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </disk> - <controller type='usb' index='0'> + <controller type='usb' index='0' model='none'> <alias name='usb'/>
Having alias for a 'none' controller is nonsense.
Good catch. The fact that we allocate one is a pre-existing issue that I will address in an additional patch. -- Andrea Bolognani / Red Hat / Virtualization

We have just changed PostParse so that MODEL_USB_NONE will be used instead of MODEL_USB_DEFAULT, so this code is no longer doing anything. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f5a80f6955..aabc3d773f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3086,11 +3086,6 @@ qemuBuildControllersByTypeCommandLine(virCommand *cmd, /* skip USB controllers with type none*/ if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) continue; - - /* skip 'default' controllers on s390 for legacy reasons */ - if (ARCH_IS_S390(def->os.arch) && - cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) - continue; } if (qemuBuildControllerDevProps(def, cont, qemuCaps, &props) < 0) -- 2.50.1

On 19/08/2025 18.22, Andrea Bolognani via Devel wrote:
We have just changed PostParse so that MODEL_USB_NONE will be used instead of MODEL_USB_DEFAULT, so this code is no longer doing anything.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f5a80f6955..aabc3d773f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3086,11 +3086,6 @@ qemuBuildControllersByTypeCommandLine(virCommand *cmd, /* skip USB controllers with type none*/ if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) continue; - - /* skip 'default' controllers on s390 for legacy reasons */ - if (ARCH_IS_S390(def->os.arch) && - cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) - continue; }
if (qemuBuildControllerDevProps(def, cont, qemuCaps, &props) < 0)
Reviewed-by: Thomas Huth <thuth@redhat.com>

On 8/19/25 18:22, Andrea Bolognani via Devel wrote:
We have just changed PostParse so that MODEL_USB_NONE will be used instead of MODEL_USB_DEFAULT, so this code is no longer doing anything.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f5a80f6955..aabc3d773f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3086,11 +3086,6 @@ qemuBuildControllersByTypeCommandLine(virCommand *cmd, /* skip USB controllers with type none*/ if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) continue; - - /* skip 'default' controllers on s390 for legacy reasons */ - if (ARCH_IS_S390(def->os.arch) && - cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) - continue; }
if (qemuBuildControllerDevProps(def, cont, qemuCaps, &props) < 0)
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Tue, Aug 19, 2025 at 18:22:25 +0200, Andrea Bolognani via Devel wrote:
We have just changed PostParse so that MODEL_USB_NONE will be used instead of MODEL_USB_DEFAULT, so this code is no longer doing anything.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 5 ----- 1 file changed, 5 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index aabc3d773f..8efcbdebae 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3043,6 +3043,11 @@ qemuBuildSkipController(const virDomainControllerDef *controller, return true; } + /* skip USB controllers with type none */ + if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && + controller->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + return true; + return false; } @@ -3081,13 +3086,6 @@ qemuBuildControllersByTypeCommandLine(virCommand *cmd, if (qemuBuildSkipController(cont, def)) continue; - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) { - - /* skip USB controllers with type none*/ - if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) - continue; - } - if (qemuBuildControllerDevProps(def, cont, qemuCaps, &props) < 0) return -1; -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:26 +0200, Andrea Bolognani via Devel wrote:
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Right now we call qemuValidateDomainDeviceDefControllerUSB() quite late, just as we're generating the QEMU command line. The original intention was likely to prevent configurations from being rejected, even though a default USB controller model could not be found, because using -usb could be used as a last resort. As it turns out, this premise was always flawed: in order for -usb to work, the underlying device still needs to be compiled into QEMU, and if that was the case then the earlier code would have detected its presence and set the model name accordingly. More recently, we have dropped the use of -usb altogether so there's simply no longer anything to fall back to. With all this in mind, we can move the validation step much earlier, making for a better user experience as any issues will be reported when the domain is defined rather than when an attempt is made to start it. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 76 +------------------ src/qemu/qemu_validate.c | 76 ++++++++++++++++++- ...ilable-pseries.ppc64-latest.abi-update.xml | 31 -------- ...matic-unavailable-pseries.ppc64-latest.xml | 31 -------- ...ic-unavailable-realview.aarch64-latest.xml | 25 ------ ...-unavailable-versatilepb.armv7l-latest.xml | 27 ------- ...controller-default-isapc.x86_64-latest.err | 2 +- ...controller-default-isapc.x86_64-latest.xml | 26 ------- ...ontroller-default-nousb.aarch64-latest.err | 2 +- ...ontroller-default-nousb.aarch64-latest.xml | 22 ------ ...fault-unavailable-g3beige.ppc64-latest.xml | 27 ------- ...fault-unavailable-i440fx.x86_64-latest.xml | 29 ------- ...default-unavailable-mac99.ppc64-latest.xml | 27 ------- ...efault-unavailable-mac99ppc.ppc-latest.xml | 24 ------ ...ault-unavailable-powernv9.ppc64-latest.xml | 27 ------- ...fault-unavailable-pseries.ppc64-latest.xml | 31 -------- ...-default-unavailable-q35.x86_64-latest.xml | 47 ------------ ...lt-unavailable-realview.aarch64-latest.xml | 25 ------ ...-unavailable-versatilepb.armv7l-latest.xml | 27 ------- ...navailable-virt-aarch64.aarch64-latest.xml | 43 ----------- ...navailable-virt-riscv64.riscv64-latest.xml | 41 ---------- ...ler-nec-xhci-unavailable.x86_64-latest.xml | 33 -------- tests/qemuxmlconftest.c | 36 ++++----- 23 files changed, 97 insertions(+), 638 deletions(-) delete mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml delete mode 100644 tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8efcbdebae..30996ee874 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2558,74 +2558,6 @@ qemuBuildFilesystemCommandLine(virCommand *cmd, } -static int -qemuControllerModelUSBToCaps(int model) -{ - switch (model) { - case VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI: - return QEMU_CAPS_PIIX3_USB_UHCI; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX4_UHCI: - return QEMU_CAPS_PIIX4_USB_UHCI; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_EHCI: - return QEMU_CAPS_USB_EHCI; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1: - case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1: - case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI2: - case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3: - return QEMU_CAPS_ICH9_USB_EHCI1; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_VT82C686B_UHCI: - return QEMU_CAPS_VT82C686B_USB_UHCI; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI: - return QEMU_CAPS_PCI_OHCI; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI: - return QEMU_CAPS_NEC_USB_XHCI; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI: - return QEMU_CAPS_DEVICE_QEMU_XHCI; - default: - return -1; - } -} - - -static int -qemuValidateDomainDeviceDefControllerUSB(const virDomainControllerDef *def, - virQEMUCaps *qemuCaps) -{ - if (def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to determine model for USB controller idx=%1$d"), - def->idx); - return -1; - } - - if (!virDeviceInfoPCIAddressIsPresent(&def->info)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing PCI address for USB controller idx=%1$d"), - def->idx); - return -1; - } - - if (!virQEMUCapsGet(qemuCaps, qemuControllerModelUSBToCaps(def->model))) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("USB controller model '%1$s' not supported in this QEMU binary"), - virDomainControllerModelUSBTypeToString(def->model)); - return -1; - } - - if (def->opts.usbopts.ports != -1) { - if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI && - def->model != VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("usb controller type '%1$s' doesn't support 'ports' with this QEMU binary"), - virDomainControllerModelUSBTypeToString(def->model)); - return -1; - } - } - - return 0; -} - - static const char * qemuBuildUSBControllerFindMasterAlias(const virDomainDef *domainDef, const virDomainControllerDef *def) @@ -2653,14 +2585,10 @@ qemuBuildUSBControllerFindMasterAlias(const virDomainDef *domainDef, static virJSONValue * qemuBuildUSBControllerDevProps(const virDomainDef *domainDef, - virDomainControllerDef *def, - virQEMUCaps *qemuCaps) + virDomainControllerDef *def) { g_autoptr(virJSONValue) props = NULL; - if (qemuValidateDomainDeviceDefControllerUSB(def, qemuCaps) < 0) - return NULL; - if (virJSONValueObjectAdd(&props, "s:driver", qemuControllerModelUSBTypeToString(def->model), "k:p2", def->opts.usbopts.ports, @@ -2956,7 +2884,7 @@ qemuBuildControllerDevProps(const virDomainDef *domainDef, break; case VIR_DOMAIN_CONTROLLER_TYPE_USB: - if (!(props = qemuBuildUSBControllerDevProps(domainDef, def, qemuCaps))) + if (!(props = qemuBuildUSBControllerDevProps(domainDef, def))) return -1; break; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ebcc9b8e8e..5a84ee46b6 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3856,6 +3856,77 @@ qemuValidateDomainDeviceDefControllerSCSI(const virDomainControllerDef *controll } +static int +qemuControllerModelUSBToCaps(int model) +{ + switch (model) { + case VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI: + return QEMU_CAPS_PIIX3_USB_UHCI; + case VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX4_UHCI: + return QEMU_CAPS_PIIX4_USB_UHCI; + case VIR_DOMAIN_CONTROLLER_MODEL_USB_EHCI: + return QEMU_CAPS_USB_EHCI; + case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1: + case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1: + case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI2: + case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3: + return QEMU_CAPS_ICH9_USB_EHCI1; + case VIR_DOMAIN_CONTROLLER_MODEL_USB_VT82C686B_UHCI: + return QEMU_CAPS_VT82C686B_USB_UHCI; + case VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI: + return QEMU_CAPS_PCI_OHCI; + case VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI: + return QEMU_CAPS_NEC_USB_XHCI; + case VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI: + return QEMU_CAPS_DEVICE_QEMU_XHCI; + default: + return -1; + } +} + + +static int +qemuValidateDomainDeviceDefControllerUSB(const virDomainControllerDef *def, + virQEMUCaps *qemuCaps) +{ + if (def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + return 0; + + if (def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to determine model for USB controller idx=%1$d"), + def->idx); + return -1; + } + + if (!virDeviceInfoPCIAddressIsPresent(&def->info)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Missing PCI address for USB controller idx=%1$d"), + def->idx); + return -1; + } + + if (!virQEMUCapsGet(qemuCaps, qemuControllerModelUSBToCaps(def->model))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("USB controller model '%1$s' not supported in this QEMU binary"), + virDomainControllerModelUSBTypeToString(def->model)); + return -1; + } + + if (def->opts.usbopts.ports != -1) { + if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI && + def->model != VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("usb controller type '%1$s' doesn't support 'ports' with this QEMU binary"), + virDomainControllerModelUSBTypeToString(def->model)); + return -1; + } + } + + return 0; +} + + /** * virValidateControllerPCIModelNameToQEMUCaps: * @modelName: model name @@ -4525,10 +4596,13 @@ qemuValidateDomainDeviceDefController(const virDomainControllerDef *controller, qemuCaps); break; + case VIR_DOMAIN_CONTROLLER_TYPE_USB: + ret = qemuValidateDomainDeviceDefControllerUSB(controller, qemuCaps); + break; + case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: - case VIR_DOMAIN_CONTROLLER_TYPE_USB: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml deleted file mode 100644 index 2b71e447e8..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.abi-update.xml +++ /dev/null @@ -1,31 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='ppc64' machine='pseries'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>POWER10</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'> - <model name='spapr-pci-host-bridge'/> - <target index='0'/> - </controller> - <audio id='1' type='none'/> - <memballoon model='none'/> - <panic model='pseries'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml deleted file mode 100644 index 2b71e447e8..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-pseries.ppc64-latest.xml +++ /dev/null @@ -1,31 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='ppc64' machine='pseries'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>POWER10</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'> - <model name='spapr-pci-host-bridge'/> - <target index='0'/> - </controller> - <audio id='1' type='none'/> - <memballoon model='none'/> - <panic model='pseries'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml deleted file mode 100644 index 128a7d420e..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.aarch64-latest.xml +++ /dev/null @@ -1,25 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='realview-eb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml deleted file mode 100644 index 93bf8dcd0a..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilepb.armv7l-latest.xml +++ /dev/null @@ -1,27 +0,0 @@ -<domain type='qemu'> - <name>armv7ltest</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='armv7l' machine='versatilepb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>arm926</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.err index a0ca4fba5d..a0401c5197 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.err +++ b/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.err @@ -1 +1 @@ -XML error: No PCI buses available +internal error: Missing PCI address for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.xml deleted file mode 100644 index c18e2b1b0d..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-isapc.x86_64-latest.xml +++ /dev/null @@ -1,26 +0,0 @@ -<domain type='qemu'> - <name>q35-test</name> - <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> - <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='x86_64' machine='isapc'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>486</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0' model='piix3-uhci'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err index a0ca4fba5d..a0401c5197 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err +++ b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err @@ -1 +1 @@ -XML error: No PCI buses available +internal error: Missing PCI address for USB controller idx=0 diff --git a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml deleted file mode 100644 index fa258c5671..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml +++ /dev/null @@ -1,22 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='collie'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='qemu-xhci'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml deleted file mode 100644 index 409aeffe87..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml +++ /dev/null @@ -1,27 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='ppc64' machine='g3beige'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>g3</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml deleted file mode 100644 index b2847caee7..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml +++ /dev/null @@ -1,29 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>qemu64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml deleted file mode 100644 index 4ee8c59607..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml +++ /dev/null @@ -1,27 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='ppc64' machine='mac99'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>ppc64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml deleted file mode 100644 index 22ec793ffa..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='ppc' machine='mac99'>hvm</type> - <boot dev='hd'/> - </os> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml deleted file mode 100644 index c27af33c06..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml +++ /dev/null @@ -1,27 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='ppc64' machine='powernv9'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>POWER9</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml deleted file mode 100644 index 2b71e447e8..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml +++ /dev/null @@ -1,31 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='ppc64' machine='pseries'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>POWER10</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'> - <model name='spapr-pci-host-bridge'/> - <target index='0'/> - </controller> - <audio id='1' type='none'/> - <memballoon model='none'/> - <panic model='pseries'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml deleted file mode 100644 index e46489882a..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml +++ /dev/null @@ -1,47 +0,0 @@ -<domain type='qemu'> - <name>q35-test</name> - <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> - <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='x86_64' machine='q35'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>qemu64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pcie-root'/> - <controller type='pci' index='1' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='1' port='0x8'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> - </controller> - <controller type='pci' index='2' model='pcie-to-pci-bridge'> - <model name='pcie-pci-bridge'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='3' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='3' port='0x9'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> - </controller> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <watchdog model='itco' action='reset'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml deleted file mode 100644 index 128a7d420e..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml +++ /dev/null @@ -1,25 +0,0 @@ -<domain type='kvm'> - <name>aarch64test</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='realview-eb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='host-passthrough' check='none'/> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml deleted file mode 100644 index 93bf8dcd0a..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb.armv7l-latest.xml +++ /dev/null @@ -1,27 +0,0 @@ -<domain type='qemu'> - <name>armv7ltest</name> - <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='armv7l' machine='versatilepb'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>arm926</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml deleted file mode 100644 index 81ddb4e5d9..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-aarch64.aarch64-latest.xml +++ /dev/null @@ -1,43 +0,0 @@ -<domain type='qemu'> - <name>test</name> - <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> - <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='virt'>hvm</type> - <boot dev='hd'/> - </os> - <features> - <gic version='2'/> - </features> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>cortex-a15</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pcie-root'/> - <controller type='pci' index='1' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='1' port='0x8'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> - </controller> - <controller type='pci' index='2' model='pcie-to-pci-bridge'> - <model name='pcie-pci-bridge'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='3' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='3' port='0x9'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> - </controller> - <audio id='1' type='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml deleted file mode 100644 index 686363457e..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-default-unavailable-virt-riscv64.riscv64-latest.xml +++ /dev/null @@ -1,41 +0,0 @@ -<domain type='qemu'> - <name>test</name> - <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> - <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='riscv64' machine='virt'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>rv64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-riscv64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> - </controller> - <controller type='pci' index='0' model='pcie-root'/> - <controller type='pci' index='1' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='1' port='0x8'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> - </controller> - <controller type='pci' index='2' model='pcie-to-pci-bridge'> - <model name='pcie-pci-bridge'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='3' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='3' port='0x9'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> - </controller> - <audio id='1' type='none'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml deleted file mode 100644 index 9039037ab7..0000000000 --- a/tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml +++ /dev/null @@ -1,33 +0,0 @@ -<domain type='qemu'> - <name>q35-test</name> - <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> - <memory unit='KiB'>2097152</memory> - <currentMemory unit='KiB'>2097152</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='x86_64' machine='q35'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>qemu64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0' model='nec-xhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pcie-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <watchdog model='itco' action='reset'/> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 9653dcc7df..66a03e61a7 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1945,7 +1945,7 @@ mymain(void) DO_TEST_FULL("usb-controller-automatic-unavailable-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); @@ -1953,25 +1953,25 @@ mymain(void) DO_TEST_FULL("usb-controller-automatic-unavailable-realview", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-automatic-unavailable-pseries", ".ppc64-latest", ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-automatic-unavailable-pseries", ".ppc64-latest.abi-update", ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); - DO_TEST_CAPS_LATEST_FAILURE("usb-controller-default-isapc"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("usb-controller-default-isapc"); DO_TEST_CAPS_LATEST("usb-controller-default-i440fx"); DO_TEST_CAPS_LATEST("usb-controller-default-q35"); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-pseries", "ppc64"); @@ -1988,14 +1988,14 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-i440fx", ".x86_64-latest", ARG_CAPS_ARCH, "x86_64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, ARG_END); /* The implicit controller can be compiled out for q35; initialization fails though */ DO_TEST_FULL("usb-controller-default-unavailable-q35", ".x86_64-latest", ARG_CAPS_ARCH, "x86_64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, ARG_END); /* However, if the USB controller is the one that gets added @@ -2011,7 +2011,7 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-pseries", ".ppc64-latest", ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, ARG_END); @@ -2024,7 +2024,7 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-virt-aarch64", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); @@ -2032,7 +2032,7 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-virt-riscv64", ".riscv64-latest", ARG_CAPS_ARCH, "riscv64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); @@ -2046,7 +2046,7 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); @@ -2059,12 +2059,12 @@ mymain(void) DO_TEST_FULL("usb-controller-default-unavailable-realview", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); /* The '-nousb' test case tests machine without a built-in USB controller */ - DO_TEST_CAPS_ARCH_LATEST_FAILURE("usb-controller-default-nousb", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("usb-controller-default-nousb", "aarch64"); DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR("usb-controller-default-nousb", "aarch64"); DO_TEST_FULL("usb-controller-default-fallback-g3beige", ".ppc64-latest", @@ -2075,7 +2075,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_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, ARG_END); @@ -2087,7 +2087,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_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, ARG_END); @@ -2099,7 +2099,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_FLAGS, FLAG_EXPECT_PARSE_ERROR, 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); @@ -2111,7 +2111,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_FLAGS, FLAG_EXPECT_PARSE_ERROR, 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"); @@ -2127,7 +2127,7 @@ mymain(void) DO_TEST_FULL("usb-controller-nec-xhci-unavailable", ".x86_64-latest", ARG_CAPS_ARCH, "x86_64", ARG_CAPS_VER, "latest", - ARG_FLAGS, FLAG_EXPECT_FAILURE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_CAPS_LATEST("usb-controller-nec-xhci-autoassign"); -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:27 +0200, Andrea Bolognani via Devel wrote:
Right now we call qemuValidateDomainDeviceDefControllerUSB() quite late, just as we're generating the QEMU command line.
The original intention was likely to prevent configurations from being rejected, even though a default USB controller model could not be found, because using -usb could be used as a last resort.
As it turns out, this premise was always flawed: in order for -usb to work, the underlying device still needs to be compiled into QEMU, and if that was the case then the earlier code would have detected its presence and set the model name accordingly.
More recently, we have dropped the use of -usb altogether so there's simply no longer anything to fall back to.
With all this in mind, we can move the validation step much earlier, making for a better user experience as any issues will be reported when the domain is defined rather than when an attempt is made to start it.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
[..] In general I agree with this patch but it will require modifications based on my prior review. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Extract the logic from qemuDomainControllerDefPostParse() to a dedicated helper. The behavior is unchanged. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 82 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 3 ++ src/qemu/qemu_postparse.c | 51 +----------------------- 3 files changed, 86 insertions(+), 50 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 186e36da03..f03624eda8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4294,6 +4294,88 @@ qemuDomainDefaultPanicModel(const virDomainDef *def) } +/** + * qemuDomainDefaultUSBControllerModel: + * @def: domain definition + * @qemuCaps: QEMU capabilities, or NULL + * @parseFlags: parse flags + * + * Choose a reasonable model to use for a USB controller where a + * specific one hasn't been provided by the user. + * + * The choice is based on a number of factors, including the guest's + * architecture and machine type. @qemuCaps, if provided, might be + * taken into consideration too. + * + * The return value can be a specific controller model, or + * VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; the latter indicates that + * no suitable model could be identified. How to behave in that + * scenario is entirely up to the caller. + * + * Returns: the model + */ +virDomainControllerModelUSB +qemuDomainDefaultUSBControllerModel(const virDomainDef *def, + virQEMUCaps *qemuCaps, + unsigned int parseFlags) +{ + virDomainControllerModelUSB model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + + /* Pick a suitable default model for the USB controller if none + * has been selected by the user and we have the qemuCaps for + * figuring out which controllers are supported. + * + * We rely on device availability instead of setting the model + * unconditionally because, for some machine types, there's a + * chance we will get away with using the legacy USB controller + * when the relevant device is not available. + * + * See qemuBuildControllersCommandLine() */ + + /* Default USB controller is piix3-uhci if available. Fall back to + * 'pci-ohci' otherwise which is the default for non-x86 machines + * which honour -usb */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + else if (!ARCH_IS_X86(def->os.arch) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + + if (ARCH_IS_S390(def->os.arch)) { + /* No default model on s390x, one has to be provided + * explicitly by the user */ + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; + } else if (ARCH_IS_PPC64(def->os.arch)) { + /* To not break migration we need to set default USB controller + * for ppc64 to pci-ohci if we cannot change ABI of the VM. + * The nec-usb-xhci or qemu-xhci controller is used as default + * only for newly defined domains or devices. */ + if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) { + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + } else if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) { + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + } else { + /* Explicitly fallback to legacy USB controller for PPC64. */ + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + } + } else if (def->os.arch == VIR_ARCH_AARCH64) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + } else if (ARCH_IS_LOONGARCH(def->os.arch)) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + } + + return model; +} + + /** * qemuDomainDefNumaCPUsRectify: * @numa: pointer to numa definition diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index ffe5bee1bf..bdcfcc6e86 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -842,6 +842,9 @@ bool qemuDomainSupportsPCI(const virDomainDef *def); bool qemuDomainSupportsPCIMultibus(const virDomainDef *def); virDomainControllerModelSCSI qemuDomainDefaultSCSIControllerModel(const virDomainDef *def, virQEMUCaps *qemuCaps); +virDomainControllerModelUSB qemuDomainDefaultUSBControllerModel(const virDomainDef *def, + virQEMUCaps *qemuCaps, + unsigned int parseFlags); int qemuDomainDefAddDefaultAudioBackend(virQEMUDriver *driver, virDomainDef *def); diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index cbef101104..46ba12cd4a 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -359,56 +359,7 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, case VIR_DOMAIN_CONTROLLER_TYPE_USB: if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT && qemuCaps) { - /* Pick a suitable default model for the USB controller if none - * has been selected by the user and we have the qemuCaps for - * figuring out which controllers are supported. - * - * We rely on device availability instead of setting the model - * unconditionally because, for some machine types, there's a - * chance we will get away with using the legacy USB controller - * when the relevant device is not available. - * - * See qemuBuildControllersCommandLine() */ - - /* Default USB controller is piix3-uhci if available. Fall back to - * 'pci-ohci' otherwise which is the default for non-x86 machines - * which honour -usb */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; - else if (!ARCH_IS_X86(def->os.arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; - - if (ARCH_IS_S390(def->os.arch)) { - /* No default model on s390x, one has to be provided - * explicitly by the user */ - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; - } else if (ARCH_IS_PPC64(def->os.arch)) { - /* To not break migration we need to set default USB controller - * for ppc64 to pci-ohci if we cannot change ABI of the VM. - * The nec-usb-xhci or qemu-xhci controller is used as default - * only for newly defined domains or devices. */ - if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) { - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - } else if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) { - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; - } else { - /* Explicitly fallback to legacy USB controller for PPC64. */ - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; - } - } else if (def->os.arch == VIR_ARCH_AARCH64) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (ARCH_IS_LOONGARCH(def->os.arch)) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - } + cont->model = qemuDomainDefaultUSBControllerModel(def, qemuCaps, parseFlags); } /* Make sure the 'none' USB controller doesn't have an address -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:28 +0200, Andrea Bolognani via Devel wrote:
Extract the logic from qemuDomainControllerDefPostParse() to a dedicated helper. The behavior is unchanged.
I don't see it changed anywhere else ... is it just to separate stuff?
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 82 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 3 ++ src/qemu/qemu_postparse.c | 51 +----------------------- 3 files changed, 86 insertions(+), 50 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Tue, Aug 19, 2025 at 18:22:28 +0200, Andrea Bolognani via Devel wrote:
Extract the logic from qemuDomainControllerDefPostParse() to a dedicated helper. The behavior is unchanged.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 82 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 3 ++ src/qemu/qemu_postparse.c | 51 +----------------------- 3 files changed, 86 insertions(+), 50 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 186e36da03..f03624eda8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4294,6 +4294,88 @@ qemuDomainDefaultPanicModel(const virDomainDef *def) }
+/** + * qemuDomainDefaultUSBControllerModel: + * @def: domain definition + * @qemuCaps: QEMU capabilities, or NULL + * @parseFlags: parse flags + * + * Choose a reasonable model to use for a USB controller where a + * specific one hasn't been provided by the user. + * + * The choice is based on a number of factors, including the guest's + * architecture and machine type. @qemuCaps, if provided, might be + * taken into consideration too.
This statement is a bit misleading. In cases where qemuCaps is NULL you must not be doing any decisions that depend on the caps that wouldn't be undone by another run of this function with caps present. In cases where the caps for given qemu are not present and the XML parsed is one of the persistent configs loaded from disk, the postparse code will be re-tried at next startup attempt where it has to be present for the VM to work. If you'd pick an incorrect model based on missing caps that'd be remembered and not fixed on startup, but it would behave differently if the caps are present.

On Thu, Sep 18, 2025 at 03:57:10PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:28 +0200, Andrea Bolognani via Devel wrote:
Extract the logic from qemuDomainControllerDefPostParse() to a dedicated helper. The behavior is unchanged.
I don't see it changed anywhere else ... is it just to separate stuff?
I'm not sure I understand the question. Yes, this commit is intended to merely factor out the existing code into a dedicated helper, without altering the behavior. Then later commits perform the modifications we want.
+/** + * qemuDomainDefaultUSBControllerModel: + * @def: domain definition + * @qemuCaps: QEMU capabilities, or NULL + * @parseFlags: parse flags + * + * Choose a reasonable model to use for a USB controller where a + * specific one hasn't been provided by the user. + * + * The choice is based on a number of factors, including the guest's + * architecture and machine type. @qemuCaps, if provided, might be + * taken into consideration too.
This statement is a bit misleading. In cases where qemuCaps is NULL you must not be doing any decisions that depend on the caps that wouldn't be undone by another run of this function with caps present.
In cases where the caps for given qemu are not present and the XML parsed is one of the persistent configs loaded from disk, the postparse code will be re-tried at next startup attempt where it has to be present for the VM to work.
If you'd pick an incorrect model based on missing caps that'd be remembered and not fixed on startup, but it would behave differently if the caps are present.
Got it. In practice things should already work correctly with the current code, and continue to do so even after my patches, since neither this helper nor its AutoAdded variant are ever called when qemuCaps is NULL. Based on this and the fact that you provided a R-b for the patch, it should be enough for me to update the comment so that it's not misleading, right? Basically s/, if provided, might/will/g -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Sep 19, 2025 at 07:26:21 -0700, Andrea Bolognani wrote:
On Thu, Sep 18, 2025 at 03:57:10PM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:28 +0200, Andrea Bolognani via Devel wrote:
Extract the logic from qemuDomainControllerDefPostParse() to a dedicated helper. The behavior is unchanged.
I don't see it changed anywhere else ... is it just to separate stuff?
I'm not sure I understand the question.
Yes, this commit is intended to merely factor out the existing code into a dedicated helper, without altering the behavior. Then later commits perform the modifications we want.
I was asking for the reason for exporting it since it's used in single place. Especially since you put it in a different module so it needs to be exported. Extracting is fine, but extracting to a different module is a bit weird if you don't reuse it.
+/** + * qemuDomainDefaultUSBControllerModel: + * @def: domain definition + * @qemuCaps: QEMU capabilities, or NULL + * @parseFlags: parse flags + * + * Choose a reasonable model to use for a USB controller where a + * specific one hasn't been provided by the user. + * + * The choice is based on a number of factors, including the guest's + * architecture and machine type. @qemuCaps, if provided, might be + * taken into consideration too.
This statement is a bit misleading. In cases where qemuCaps is NULL you must not be doing any decisions that depend on the caps that wouldn't be undone by another run of this function with caps present.
In cases where the caps for given qemu are not present and the XML parsed is one of the persistent configs loaded from disk, the postparse code will be re-tried at next startup attempt where it has to be present for the VM to work.
If you'd pick an incorrect model based on missing caps that'd be remembered and not fixed on startup, but it would behave differently if the caps are present.
Got it. In practice things should already work correctly with the current code, and continue to do so even after my patches, since neither this helper nor its AutoAdded variant are ever called when qemuCaps is NULL.
Based on this and the fact that you provided a R-b for the patch, it should be enough for me to update the comment so that it's not misleading, right? Basically s/, if provided, might/will/g
Yes, updating the comment is sufficient. It needs to mention that 'qemuCaps' *might* be NULL, in which case it must not try to infer any information that something is *not* supported because it actually may be, thus must pick the default that makes us re-check.

On Fri, Sep 19, 2025 at 04:31:07PM +0200, Peter Krempa wrote:
On Fri, Sep 19, 2025 at 07:26:21 -0700, Andrea Bolognani wrote:
Yes, this commit is intended to merely factor out the existing code into a dedicated helper, without altering the behavior. Then later commits perform the modifications we want.
I was asking for the reason for exporting it since it's used in single place. Especially since you put it in a different module so it needs to be exported.
Extracting is fine, but extracting to a different module is a bit weird if you don't reuse it.
I moved it next to the other functions that pick default models, namely SCSI controllers and panic devices. Admittedly the helper for network devices is in qemu_postparse.c, so we're not entirely consistent. Big surprise :) I can keep the new helpers in the current file if you prefer, but I think in the long run it would be better to have them all in one place, and since the SCSI one is called outside of qemu_postparse.c too it seems that qemu_domain.c is a better location. But we can have that conversation at a later date. -- Andrea Bolognani / Red Hat / Virtualization

In addition to the code in qemuDomainControllerDefPostParse(), which we have just factored into its own function, we also have some code in qemuDomainDefAddDefaultDevices() that deals with choosing the USB controller model for a couple of specific machine types. Once again, extract the logic to a dedicated helper. The behavior is unchanged. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 57 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 2 ++ src/qemu/qemu_postparse.c | 27 +++++++------------ 3 files changed, 69 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f03624eda8..639506d22a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4376,6 +4376,63 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, } +/** + * qemuDomainDefaultUSBControllerModelAutoAdded: + * @def: domain definition + * @qemuCaps: QEMU capabilities, or NULL + * + * Choose a reasonable model to use for a USB controller that is + * being automatically added to a domain. + * + * The choice is based on a number of factors, including the guest's + * architecture and machine type. @qemuCaps, if provided, might be + * taken into consideration too. + * + * The return value can be a specific controller model, or + * VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; the latter indicates that + * no suitable model could be identified. How to behave in that + * scenario is entirely up to the caller. + * + * Additionally, VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE can be returned + * to indicate that the caller should not auto-add the USB controller + * after all. + * + * Returns: the model + */ +virDomainControllerModelUSB +qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, + virQEMUCaps *qemuCaps) +{ + virDomainControllerModelUSB model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + + if (ARCH_IS_X86(def->os.arch)) { + if (qemuDomainIsQ35(def)) { + /* Prefer adding a USB3 controller if supported, fall back + * to USB2 if there is no USB3 available, and if that's + * unavailable don't add anything. + */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1; + else + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; + } + } + + if (ARCH_IS_ARM(def->os.arch)) { + if (STREQ(def->os.machine, "versatilepb") || + STRPREFIX(def->os.machine, "realview-eb")) + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + } + + return model; +} + + /** * qemuDomainDefNumaCPUsRectify: * @numa: pointer to numa definition diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index bdcfcc6e86..5ccd3b2dbb 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -845,6 +845,8 @@ virDomainControllerModelSCSI qemuDomainDefaultSCSIControllerModel(const virDomai virDomainControllerModelUSB qemuDomainDefaultUSBControllerModel(const virDomainDef *def, virQEMUCaps *qemuCaps, unsigned int parseFlags); +virDomainControllerModelUSB qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, + virQEMUCaps *qemuCaps); int qemuDomainDefAddDefaultAudioBackend(virQEMUDriver *driver, virDomainDef *def); diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 46ba12cd4a..3befd4a775 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1189,7 +1189,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, virQEMUCaps *qemuCaps) { bool addDefaultUSB = false; - int usbModel = -1; /* "default for machinetype" */ + virDomainControllerModelUSB usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; int pciRoot; /* index within def->controllers */ bool addImplicitSATA = false; bool addPCIRoot = false; @@ -1223,20 +1223,6 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, if (virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM) { addIOMMU = true; } - - /* Prefer adding a USB3 controller if supported, fall back - * to USB2 if there is no USB3 available, and if that's - * unavailable don't add anything. - */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) - usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1)) - usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1; - else - addDefaultUSB = false; - break; } if (qemuDomainIsI440FX(def)) addPCIRoot = true; @@ -1252,8 +1238,6 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, STRPREFIX(def->os.machine, "realview-eb")) { addPCIRoot = true; addDefaultUSB = true; - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; } if (qemuDomainIsARMVirt(def)) @@ -1374,6 +1358,15 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, return -1; } + if (addDefaultUSB && usbModel == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) { + usbModel = qemuDomainDefaultUSBControllerModelAutoAdded(def, qemuCaps); + + /* If no reasonable model can be figured out, we should + * simply not add the default USB controller */ + if (usbModel == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + addDefaultUSB = false; + } + if (addDefaultUSB && virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_USB, 0) < 0) virDomainDefAddUSBController(def, 0, usbModel); -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:29 +0200, Andrea Bolognani via Devel wrote:
In addition to the code in qemuDomainControllerDefPostParse(), which we have just factored into its own function, we also have some code in qemuDomainDefAddDefaultDevices() that deals with choosing the USB controller model for a couple of specific machine types.
Once again, extract the logic to a dedicated helper. The behavior is unchanged.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 57 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 2 ++ src/qemu/qemu_postparse.c | 27 +++++++------------ 3 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f03624eda8..639506d22a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4376,6 +4376,63 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, }
+/** + * qemuDomainDefaultUSBControllerModelAutoAdded: + * @def: domain definition + * @qemuCaps: QEMU capabilities, or NULL + * + * Choose a reasonable model to use for a USB controller that is + * being automatically added to a domain. + * + * The choice is based on a number of factors, including the guest's + * architecture and machine type. @qemuCaps, if provided, might be + * taken into consideration too.
Same comment about qemuCaps as in prior commit. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

As well as qemuDomainDefaultUSBControllerModelAutoAdded(). Switch from the current approach, in which an initial (poor) default is picked and then a better one later overwrites it, to the more common and easy to reason about pattern where the value is returned directly as soon as possible. The behavior is unchanged. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 121 ++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 639506d22a..3886b59026 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4319,60 +4319,60 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, virQEMUCaps *qemuCaps, unsigned int parseFlags) { - virDomainControllerModelUSB model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE); - /* Pick a suitable default model for the USB controller if none - * has been selected by the user and we have the qemuCaps for - * figuring out which controllers are supported. - * - * We rely on device availability instead of setting the model - * unconditionally because, for some machine types, there's a - * chance we will get away with using the legacy USB controller - * when the relevant device is not available. - * - * See qemuBuildControllersCommandLine() */ + if (ARCH_IS_LOONGARCH(def->os.arch)) { + /* Use qemu-xhci (USB3) for modern architectures */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - /* Default USB controller is piix3-uhci if available. Fall back to - * 'pci-ohci' otherwise which is the default for non-x86 machines - * which honour -usb */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; - else if (!ARCH_IS_X86(def->os.arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + /* No fallback if that's not available */ + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + } + + if (def->os.arch == VIR_ARCH_AARCH64) { + /* Prefer USB3 */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + + /* Fall through */ + } if (ARCH_IS_S390(def->os.arch)) { /* No default model on s390x, one has to be provided * explicitly by the user */ - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; - } else if (ARCH_IS_PPC64(def->os.arch)) { - /* To not break migration we need to set default USB controller - * for ppc64 to pci-ohci if we cannot change ABI of the VM. - * The nec-usb-xhci or qemu-xhci controller is used as default - * only for newly defined domains or devices. */ - if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) { - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - } else if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) { - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; - } else { - /* Explicitly fallback to legacy USB controller for PPC64. */ - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; - } - } else if (def->os.arch == VIR_ARCH_AARCH64) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (ARCH_IS_LOONGARCH(def->os.arch)) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; } - return model; + if (ARCH_IS_PPC64(def->os.arch)) { + /* Newly-defined guests should use USB3 if possible */ + if (abiUpdate && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (abiUpdate && virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + + /* To preserve backwards compatibility, existing guests need to + * use pci-ohci (USB1) instead */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + + /* If neither USB3 nor USB1 can be used, bail */ + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + } + + /* The default USB controller is piix3-uhci (USB1) if available. + * This choice is a fairly poor one, rooted primarily in + * historical reasons; thankfully, in most cases we will have + * picked a much more reasonable value before ever getting here */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + else if (!ARCH_IS_X86(def->os.arch) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; } @@ -4403,22 +4403,21 @@ virDomainControllerModelUSB qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, virQEMUCaps *qemuCaps) { - virDomainControllerModelUSB model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; - if (ARCH_IS_X86(def->os.arch)) { if (qemuDomainIsQ35(def)) { - /* Prefer adding a USB3 controller if supported, fall back - * to USB2 if there is no USB3 available, and if that's - * unavailable don't add anything. - */ + /* Prefer USB3 */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1; - else - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + + /* Fall back to USB2 */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1; + + /* If neither USB3 nor USB2 are available, do not add + * the controller at all */ + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; } } @@ -4426,10 +4425,10 @@ qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, if (STREQ(def->os.machine, "versatilepb") || STRPREFIX(def->os.machine, "realview-eb")) if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; } - return model; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; } -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:30 +0200, Andrea Bolognani via Devel wrote:
As well as qemuDomainDefaultUSBControllerModelAutoAdded().
Either split the patch or mention both in the summary.
Switch from the current approach, in which an initial (poor) default is picked and then a better one later overwrites it, to the more common and easy to reason about pattern where the value is returned directly as soon as possible. The behavior is unchanged.
The commit message doesn't mention functional changes ...
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 121 ++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 61 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 639506d22a..3886b59026 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4319,60 +4319,60 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, virQEMUCaps *qemuCaps, unsigned int parseFlags) { - virDomainControllerModelUSB model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
- /* Pick a suitable default model for the USB controller if none - * has been selected by the user and we have the qemuCaps for - * figuring out which controllers are supported. - * - * We rely on device availability instead of setting the model - * unconditionally because, for some machine types, there's a - * chance we will get away with using the legacy USB controller - * when the relevant device is not available. - * - * See qemuBuildControllersCommandLine() */ + if (ARCH_IS_LOONGARCH(def->os.arch)) { + /* Use qemu-xhci (USB3) for modern architectures */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
... but the code considered VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI if available as the default on non-x86 which is not preserved in the loongarch branch. (by setting it first and the loongarch branch not doing anything if XHCI is not present) ...
- /* Default USB controller is piix3-uhci if available. Fall back to - * 'pci-ohci' otherwise which is the default for non-x86 machines - * which honour -usb */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; - else if (!ARCH_IS_X86(def->os.arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + /* No fallback if that's not available */ + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT;
... but this skips the fallback.
+ } + + if (def->os.arch == VIR_ARCH_AARCH64) { + /* Prefer USB3 */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + + /* Fall through */
Here with aarch the logic is preserved. Although I think for clarity it'd be better to simply condense all arch-specific logic here (e.g. by copying out the default.
+ }
if (ARCH_IS_S390(def->os.arch)) { /* No default model on s390x, one has to be provided * explicitly by the user */ - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; - } else if (ARCH_IS_PPC64(def->os.arch)) { - /* To not break migration we need to set default USB controller - * for ppc64 to pci-ohci if we cannot change ABI of the VM. - * The nec-usb-xhci or qemu-xhci controller is used as default - * only for newly defined domains or devices. */ - if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) { - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - } else if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) { - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; - } else { - /* Explicitly fallback to legacy USB controller for PPC64. */ - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; - } - } else if (def->os.arch == VIR_ARCH_AARCH64) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (ARCH_IS_LOONGARCH(def->os.arch)) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; }
- return model; + if (ARCH_IS_PPC64(def->os.arch)) { + /* Newly-defined guests should use USB3 if possible */ + if (abiUpdate && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (abiUpdate && virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + + /* To preserve backwards compatibility, existing guests need to + * use pci-ohci (USB1) instead */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + + /* If neither USB3 nor USB1 can be used, bail */ + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT;
So that we don't have "fall through" and normal blocks.
+ } + + /* The default USB controller is piix3-uhci (USB1) if available. + * This choice is a fairly poor one, rooted primarily in + * historical reasons; thankfully, in most cases we will have + * picked a much more reasonable value before ever getting here */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI;
Including having an explicit block for x86(_64) with and leaving the rest of the logic for non-mentioned arches.
+ else if (!ARCH_IS_X86(def->os.arch) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; }
@@ -4403,22 +4403,21 @@ virDomainControllerModelUSB qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, virQEMUCaps *qemuCaps) { - virDomainControllerModelUSB model = VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; - if (ARCH_IS_X86(def->os.arch)) { if (qemuDomainIsQ35(def)) { - /* Prefer adding a USB3 controller if supported, fall back - * to USB2 if there is no USB3 available, and if that's - * unavailable don't add anything. - */ + /* Prefer USB3 */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1; - else - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + + /* Fall back to USB2 */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1; + + /* If neither USB3 nor USB2 are available, do not add + * the controller at all */ + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; }
This explicit logic is much better.
}
@@ -4426,10 +4425,10 @@ qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, if (STREQ(def->os.machine, "versatilepb") || STRPREFIX(def->os.machine, "realview-eb")) if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; }
- return model; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; }
With the changes I've suggested: Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Fri, Sep 19, 2025 at 11:19:38AM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:30 +0200, Andrea Bolognani via Devel wrote:
Switch from the current approach, in which an initial (poor) default is picked and then a better one later overwrites it, to the more common and easy to reason about pattern where the value is returned directly as soon as possible. The behavior is unchanged.
The commit message doesn't mention functional changes ...
+ if (ARCH_IS_LOONGARCH(def->os.arch)) { + /* Use qemu-xhci (USB3) for modern architectures */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
... but the code considered VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI if available as the default on non-x86 which is not preserved in the loongarch branch. (by setting it first and the loongarch branch not doing anything if XHCI is not present) ...
That was unintentional. Not that I think it's reasonable for loongarch64 domains to fall back to pci-ohci, but a change in that direction should happen in its own commit and be justified appropriately, not as part of what was supposed to be a pure refactor. This only serves to highlight how error-prone the current approach makes things. It's way just too easy to miss stuff.
+ if (def->os.arch == VIR_ARCH_AARCH64) { + /* Prefer USB3 */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; + + /* Fall through */
Here with aarch the logic is preserved. Although I think for clarity it'd be better to simply condense all arch-specific logic here (e.g. by copying out the default.
[...]
So that we don't have "fall through" and normal blocks.
+ /* The default USB controller is piix3-uhci (USB1) if available. + * This choice is a fairly poor one, rooted primarily in + * historical reasons; thankfully, in most cases we will have + * picked a much more reasonable value before ever getting here */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI;
Including having an explicit block for x86(_64) with and leaving the rest of the logic for non-mentioned arches.
As you noticed, that happens in a later patch. I figured it would be slightly nicer to do things in multiple discrete steps, but looking back at the patches it's ultimately one of those situations where you can't really split things cleanly, so effectively I've just needlessly divided the big, confusing rewrite into two big, confusing patches. Not very helpful. I'll rewrite things according to your suggestions. -- Andrea Bolognani / Red Hat / Virtualization

Currently we fall back to the x86-derived default of piix3-uhci, which is a USB1 controller that's not virtualization-friendly and overall a terrible choice for a modern architecture. The fact that we didn't choose a better default when RISC-V support was introduced was an oversight which is now addressed. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 3 ++- ...ault-models.riscv64-latest.abi-update.args | 15 +++++------ ...fault-models.riscv64-latest.abi-update.xml | 26 ++++++++----------- ...64-virt-default-models.riscv64-latest.args | 15 +++++------ ...v64-virt-default-models.riscv64-latest.xml | 26 ++++++++----------- ...r-default-virt-riscv64.riscv64-latest.args | 5 ++-- ...er-default-virt-riscv64.riscv64-latest.xml | 12 +++------ tests/qemuxmlconftest.c | 2 +- 8 files changed, 45 insertions(+), 59 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3886b59026..d5ddc4ef43 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4321,7 +4321,8 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, { bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE); - if (ARCH_IS_LOONGARCH(def->os.arch)) { + if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsRISCVVirt(def)) { /* Use qemu-xhci (USB3) for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args index 00ecc83126..99e1946d98 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args @@ -28,20 +28,19 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -boot strict=on \ -device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ -device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ --device '{"driver":"pcie-pci-bridge","id":"pci.3","bus":"pci.1","addr":"0x0"}' \ --device '{"driver":"pcie-root-port","port":10,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x2"}' \ --device '{"driver":"pcie-root-port","port":11,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x3"}' \ --device '{"driver":"pcie-root-port","port":12,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x4"}' \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.3","addr":"0x1"}' \ --device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \ +-device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \ +-device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.2","addr":"0x0"}' \ +-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.3","addr":"0x0"}' \ -netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.2","addr":"0x0"}' \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ -serial chardev:charserial0 \ -chardev socket,id=chrtpm,path=/dev/test \ -tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \ -device '{"driver":"tpm-tis-device","tpmdev":"tpm-tpm0","id":"tpm0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \ +-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4","addr":"0x0"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml index 4543364c89..620da73422 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml @@ -17,11 +17,11 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-riscv64</emulator> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> <controller type='scsi' index='0' model='virtio-scsi'> - <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> @@ -34,29 +34,25 @@ <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> - <controller type='pci' index='3' model='pcie-to-pci-bridge'> - <model name='pcie-pci-bridge'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='4' model='pcie-root-port'> + <controller type='pci' index='3' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='4' port='0xa'/> + <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> - <controller type='pci' index='5' model='pcie-root-port'> + <controller type='pci' index='4' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='5' port='0xb'/> + <target chassis='4' port='0xb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/> </controller> - <controller type='pci' index='6' model='pcie-root-port'> + <controller type='pci' index='5' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='6' port='0xc'/> + <target chassis='5' port='0xc'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/> </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> <serial type='pty'> <target type='system-serial' port='0'> @@ -72,7 +68,7 @@ <audio id='1' type='none'/> <video> <model type='virtio' heads='1' primary='yes'/> - <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args index 00ecc83126..99e1946d98 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args @@ -28,20 +28,19 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -boot strict=on \ -device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ -device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ --device '{"driver":"pcie-pci-bridge","id":"pci.3","bus":"pci.1","addr":"0x0"}' \ --device '{"driver":"pcie-root-port","port":10,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x2"}' \ --device '{"driver":"pcie-root-port","port":11,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x3"}' \ --device '{"driver":"pcie-root-port","port":12,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x4"}' \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.3","addr":"0x1"}' \ --device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \ +-device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \ +-device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.2","addr":"0x0"}' \ +-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.3","addr":"0x0"}' \ -netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.2","addr":"0x0"}' \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ -serial chardev:charserial0 \ -chardev socket,id=chrtpm,path=/dev/test \ -tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \ -device '{"driver":"tpm-tis-device","tpmdev":"tpm-tpm0","id":"tpm0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \ +-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4","addr":"0x0"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml index 4543364c89..620da73422 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml @@ -17,11 +17,11 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-riscv64</emulator> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> <controller type='scsi' index='0' model='virtio-scsi'> - <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> @@ -34,29 +34,25 @@ <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> - <controller type='pci' index='3' model='pcie-to-pci-bridge'> - <model name='pcie-pci-bridge'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='4' model='pcie-root-port'> + <controller type='pci' index='3' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='4' port='0xa'/> + <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> - <controller type='pci' index='5' model='pcie-root-port'> + <controller type='pci' index='4' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='5' port='0xb'/> + <target chassis='4' port='0xb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/> </controller> - <controller type='pci' index='6' model='pcie-root-port'> + <controller type='pci' index='5' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='6' port='0xc'/> + <target chassis='5' port='0xc'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/> </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> <serial type='pty'> <target type='system-serial' port='0'> @@ -72,7 +68,7 @@ <audio id='1' type='none'/> <video> <model type='virtio' heads='1' primary='yes'/> - <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args index 20ef922cf6..a0f79e499e 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args @@ -27,9 +27,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -no-shutdown \ -boot strict=on \ -device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ --device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ --device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \ -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-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml index 28f2c9eca4..641ea6c3d9 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml @@ -17,8 +17,8 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-riscv64</emulator> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> @@ -26,13 +26,9 @@ <target chassis='1' port='0x8'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> </controller> - <controller type='pci' index='2' model='pcie-to-pci-bridge'> - <model name='pcie-pci-bridge'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='3' model='pcie-root-port'> + <controller type='pci' index='2' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='3' port='0x9'/> + <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 66a03e61a7..a955861dc4 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2033,7 +2033,7 @@ mymain(void) ARG_CAPS_ARCH, "riscv64", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, ARG_END); /* controller selection tests for various uncommon machine types */ -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:31 +0200, Andrea Bolognani via Devel wrote:
Currently we fall back to the x86-derived default of piix3-uhci, which is a USB1 controller that's not virtualization-friendly and overall a terrible choice for a modern architecture. The fact that we didn't choose a better default when RISC-V support was introduced was an oversight which is now addressed.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 3 ++- ...ault-models.riscv64-latest.abi-update.args | 15 +++++------ ...fault-models.riscv64-latest.abi-update.xml | 26 ++++++++----------- ...64-virt-default-models.riscv64-latest.args | 15 +++++------ ...v64-virt-default-models.riscv64-latest.xml | 26 ++++++++----------- ...r-default-virt-riscv64.riscv64-latest.args | 5 ++-- ...er-default-virt-riscv64.riscv64-latest.xml | 12 +++------ tests/qemuxmlconftest.c | 2 +- 8 files changed, 45 insertions(+), 59 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3886b59026..d5ddc4ef43 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4321,7 +4321,8 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, { bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
- if (ARCH_IS_LOONGARCH(def->os.arch)) { + if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsRISCVVirt(def)) { /* Use qemu-xhci (USB3) for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
As noted before this removes any fallback to the old controller; is that what you intended?

On Fri, Sep 19, 2025 at 11:23:14AM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:31 +0200, Andrea Bolognani via Devel wrote:
+ if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsRISCVVirt(def)) { /* Use qemu-xhci (USB3) for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
As noted before this removes any fallback to the old controller; is that what you intended?
Yeah, a fallback on pci-ohci just doesn't make sense for recent architectures such as riscv64 and loongarch64. But this change should be spelled out explicitly in the commit message, just like the change in the actual default is. -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Sep 19, 2025 at 08:10:41 -0700, Andrea Bolognani wrote:
On Fri, Sep 19, 2025 at 11:23:14AM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:31 +0200, Andrea Bolognani via Devel wrote:
+ if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsRISCVVirt(def)) { /* Use qemu-xhci (USB3) for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
As noted before this removes any fallback to the old controller; is that what you intended?
Yeah, a fallback on pci-ohci just doesn't make sense for recent architectures such as riscv64 and loongarch64. But this change should be spelled out explicitly in the commit message, just like the change in the actual default is.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Since these architectures were introduced when qemu-xhci was already a thing, we never considered allowing the older nec-xhci model as a fallback. That said, every other architecture that defaults to USB3 allows this, so we might as well be consistent. The chances of nec-xhci being available when qemu-xhci isn't are of course close to zero. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 4 +- ...-fallback-virt-riscv64.riscv64-latest.args | 34 +++++++++++++++++ ...t-fallback-virt-riscv64.riscv64-latest.xml | 37 +++++++++++++++++++ ...ntroller-default-fallback-virt-riscv64.xml | 1 + tests/qemuxmlconftest.c | 7 +++- 5 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d5ddc4ef43..529acefbd7 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4323,9 +4323,11 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, if (ARCH_IS_LOONGARCH(def->os.arch) || qemuDomainIsRISCVVirt(def)) { - /* Use qemu-xhci (USB3) for modern architectures */ + /* Use USB3 for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; /* No fallback if that's not available */ return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args new file mode 100644 index 0000000000..7292cb52db --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram,acpi=off \ +-accel tcg \ +-cpu rv64 \ +-m size=2097152k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-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 \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"nec-usb-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \ +-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-fallback-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml new file mode 100644 index 0000000000..6f0461d0fc --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml @@ -0,0 +1,37 @@ +<domain type='qemu'> + <name>test</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>rv64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='usb' index='0' model='nec-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml new file mode 120000 index 0000000000..061240f8f2 --- /dev/null +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml @@ -0,0 +1 @@ +usb-controller-default-virt-riscv64.xml \ No newline at end of file diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index a955861dc4..439aa42e6b 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2029,11 +2029,16 @@ mymain(void) ARG_END); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-virt-riscv64", "riscv64"); + DO_TEST_FULL("usb-controller-default-fallback-virt-riscv64", ".riscv64-latest", + ARG_CAPS_ARCH, "riscv64", + ARG_CAPS_VER, "latest", + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, + ARG_END); DO_TEST_FULL("usb-controller-default-unavailable-virt-riscv64", ".riscv64-latest", ARG_CAPS_ARCH, "riscv64", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, ARG_END); /* controller selection tests for various uncommon machine types */ -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:32 +0200, Andrea Bolognani via Devel wrote:
Since these architectures were introduced when qemu-xhci was already a thing, we never considered allowing the older nec-xhci model as a fallback.
That said, every other architecture that defaults to USB3 allows this, so we might as well be consistent. The chances of nec-xhci being available when qemu-xhci isn't are of course close to zero.
I don't really think consistency is a sound argument here. If either of the arches were introduced post qemu-xhci I don't se this as making sense. Yes distros can compile it out in theory but in practice it's nonsense as you'd be emulating some real hardware rather than having a cleaner impl.

This is another case where the current behavior can be traced back to the fact that x86 was the only architecture to really be taken into account for a long time: in reality, using an Intel-specific USB1 controller for a modern, PCIe-native, virtualization-friendly Arm guest just doesn't make any sense. Remove this fallback. All virt machine types now behave the same across architectures. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 1 + ...default-fallback-virt-aarch64.aarch64-latest.args | 5 ++--- ...-default-fallback-virt-aarch64.aarch64-latest.xml | 12 ++++-------- tests/qemuxmlconftest.c | 4 ++-- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 529acefbd7..df64ddbec1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4322,6 +4322,7 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE); if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsARMVirt(def) || qemuDomainIsRISCVVirt(def)) { /* Use USB3 for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args index 63ea7be2aa..44689d81f9 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args @@ -27,9 +27,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -no-shutdown \ -boot strict=on \ -device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ --device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ --device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"nec-usb-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \ -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-fallback-virt-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml index cea6dde62d..943c433f40 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml @@ -20,8 +20,8 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + <controller type='usb' index='0' model='nec-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> @@ -29,13 +29,9 @@ <target chassis='1' port='0x8'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> </controller> - <controller type='pci' index='2' model='pcie-to-pci-bridge'> - <model name='pcie-pci-bridge'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='3' model='pcie-root-port'> + <controller type='pci' index='2' model='pcie-root-port'> <model name='pcie-root-port'/> - <target chassis='3' port='0x9'/> + <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 439aa42e6b..84e37c4cb3 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2019,13 +2019,13 @@ mymain(void) DO_TEST_FULL("usb-controller-default-fallback-virt-aarch64", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-default-unavailable-virt-aarch64", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-virt-riscv64", "riscv64"); -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:33 +0200, Andrea Bolognani via Devel wrote:
This is another case where the current behavior can be traced back to the fact that x86 was the only architecture to really be taken into account for a long time: in reality, using an Intel-specific USB1 controller for a modern, PCIe-native, virtualization-friendly Arm guest just doesn't make any sense.
Remove this fallback. All virt machine types now behave the same across architectures.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 1 + ...default-fallback-virt-aarch64.aarch64-latest.args | 5 ++--- ...-default-fallback-virt-aarch64.aarch64-latest.xml | 12 ++++-------- tests/qemuxmlconftest.c | 4 ++-- 4 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 529acefbd7..df64ddbec1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4322,6 +4322,7 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsARMVirt(def) || qemuDomainIsRISCVVirt(def)) { /* Use USB3 for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI))
I agree with using the same code as long as it doesn't require the NEC controller in the fallback path. If the aarch virt machine requires it, have a separate branch for it, but adding a pointless fallback to other arches doesn't make it worth.

On Fri, Sep 19, 2025 at 11:27:06AM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:33 +0200, Andrea Bolognani via Devel wrote:
if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsARMVirt(def) || qemuDomainIsRISCVVirt(def)) { /* Use USB3 for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI))
I agree with using the same code as long as it doesn't require the NEC controller in the fallback path. If the aarch virt machine requires it, have a separate branch for it, but adding a pointless fallback to other arches doesn't make it worth.
Okay, I don't feel very strongly about it. It just made the code a bit shorter, but in practice there is basically no scenario in which nec-xhci is available but qemu-xhci isn't so I'm fine with leaving out that fallback option. -- Andrea Bolognani / Red Hat / Virtualization

At this point the USB controller model selection logic is mostly sane, but there are still a few remaining oddities. First of all, piix3-uhci (USB1) is used in way too many contexts, either as default or fallback choice, while it really should be relegated to x86 guests only. Additionally, we're explicitly defaulting to pci-ohci (USB1) for a couple of Arm machine types, and limiting the default of qemu-xhci (USB3) to aarch64 only instead of using it for 32-bit guests as well. Address all of the aforementioned quirks. The result is a reasonably consistent experience across architectures, with USB3 generally being used whenever available, Intel-specific USB controllers only showing up in x86 guests, and pci-ohci acting as the vaguely reasonable falllback across the board. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 28 ++++++++----------- ...iew-minimal.aarch64-latest.abi-update.args | 2 +- ...view-minimal.aarch64-latest.abi-update.xml | 2 +- ...rch64-realview-minimal.aarch64-latest.args | 2 +- ...arch64-realview-minimal.aarch64-latest.xml | 2 +- ...lepb-minimal.armv7l-latest.abi-update.args | 2 +- ...ilepb-minimal.armv7l-latest.abi-update.xml | 2 +- ...v7l-versatilepb-minimal.armv7l-latest.args | 2 +- ...mv7l-versatilepb-minimal.armv7l-latest.xml | 2 +- tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args | 2 +- tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml | 2 +- ...c-mac99-minimal.ppc-latest.abi-update.args | 2 +- ...pc-mac99-minimal.ppc-latest.abi-update.xml | 2 +- .../ppc-mac99-minimal.ppc-latest.args | 2 +- .../ppc-mac99-minimal.ppc-latest.xml | 2 +- .../ppce500-serial.ppc-latest.args | 2 +- .../ppce500-serial.ppc-latest.xml | 2 +- ...ler-automatic-realview.aarch64-latest.args | 2 +- ...ller-automatic-realview.aarch64-latest.xml | 2 +- ...r-automatic-versatilepb.armv7l-latest.args | 2 +- ...er-automatic-versatilepb.armv7l-latest.xml | 2 +- ...ault-fallback-realview.aarch64-latest.args | 2 +- ...fault-fallback-realview.aarch64-latest.xml | 2 +- ...ontroller-default-mac99ppc.ppc-latest.args | 2 +- ...controller-default-mac99ppc.ppc-latest.xml | 2 +- ...ler-default-versatilepb.armv7l-latest.args | 2 +- ...ller-default-versatilepb.armv7l-latest.xml | 2 +- tests/qemuxmlconftest.c | 16 +++++------ 28 files changed, 46 insertions(+), 50 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index df64ddbec1..2c7d91f597 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4334,7 +4334,7 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; } - if (def->os.arch == VIR_ARCH_AARCH64) { + if (ARCH_IS_ARM(def->os.arch)) { /* Prefer USB3 */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; @@ -4366,14 +4366,17 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; } - /* The default USB controller is piix3-uhci (USB1) if available. - * This choice is a fairly poor one, rooted primarily in - * historical reasons; thankfully, in most cases we will have - * picked a much more reasonable value before ever getting here */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) - return VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; - else if (!ARCH_IS_X86(def->os.arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + if (ARCH_IS_X86(def->os.arch)) { + /* Use piix3-uhci (USB1) for backwards compatibility */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + } + + /* Most common architectures and machine types have been already + * handled above; for the remaining cases, pci-ohci (USB1) is a + * sensible enough fallback */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; @@ -4425,13 +4428,6 @@ qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, } } - if (ARCH_IS_ARM(def->os.arch)) { - if (STREQ(def->os.machine, "versatilepb") || - STRPREFIX(def->os.machine, "realview-eb")) - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; - } - return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; } diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args index 0d956241fc..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml index c31c7b2bbc..056e5e56a8 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml @@ -15,7 +15,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args index 0d956241fc..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml index c31c7b2bbc..056e5e56a8 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml @@ -15,7 +15,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args index a05a413290..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml index 7b21b24927..a9da2a3b13 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml @@ -17,7 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args index a05a413290..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml index 7b21b24927..a9da2a3b13 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml @@ -17,7 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args index 8032ad7f0e..bdc86620c8 100644 --- a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args +++ b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -initrd /media/ram/ramdisk \ -append 'root=/dev/ram rw console=ttyS0,115200' \ -dtb /media/ram/test.dtb \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -chardev pty,id=charserial0 \ -serial chardev:charserial0 \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml index 400f749eb0..31fcc3d053 100644 --- a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml +++ b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml @@ -18,7 +18,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args index 8600eec328..9c7c884c83 100644 --- a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args +++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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 \ diff --git a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml index 215c196fbf..633aa684da 100644 --- a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml @@ -14,7 +14,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.args b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.args index 8600eec328..9c7c884c83 100644 --- a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.args +++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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 \ diff --git a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.xml b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.xml index 215c196fbf..633aa684da 100644 --- a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.xml +++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.xml @@ -14,7 +14,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.args b/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.args index 84abffdc26..21aa64b323 100644 --- a/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.args +++ b/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.args @@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -kernel /media/ram/uImage \ -initrd /media/ram/ramdisk \ -append 'root=/dev/ram rw console=ttyS0,115200' \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -chardev pty,id=charserial0 \ -serial chardev:charserial0 \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.xml b/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.xml index c6c41d7726..05076022a3 100644 --- a/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.xml +++ b/tests/qemuxmlconfdata/ppce500-serial.ppc-latest.xml @@ -17,7 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args index 0d956241fc..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -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-automatic-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml index 250da1b5e0..8bb25de20a 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml @@ -15,7 +15,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args index a05a413290..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -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-automatic-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml index 482029e3b0..8a12dda0f7 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml @@ -17,7 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args index ccbff79f35..0d956241fc 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ -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-fallback-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml index 8bb25de20a..250da1b5e0 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml @@ -15,7 +15,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <controller type='usb' index='0' model='qemu-xhci'> + <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args index dcb2b49a53..da5437bc24 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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-mac99ppc.ppc-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.xml index 02cd54d7f7..2fbca012c9 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.xml @@ -14,7 +14,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args index 8636c54dfe..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -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-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml index e1a607c256..8a12dda0f7 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml @@ -17,7 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 84e37c4cb3..fe681d47d7 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1946,7 +1946,7 @@ mymain(void) ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_CAPS_ARCH_LATEST("usb-controller-automatic-realview", "aarch64"); @@ -1954,7 +1954,7 @@ mymain(void) ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-automatic-unavailable-pseries", ".ppc64-latest", @@ -2046,26 +2046,26 @@ mymain(void) DO_TEST_FULL("usb-controller-default-fallback-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-default-unavailable-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-realview", "aarch64"); DO_TEST_FULL("usb-controller-default-fallback-realview", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-default-unavailable-realview", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_LAST, ARG_END); /* The '-nousb' test case tests machine without a built-in USB controller */ @@ -2099,13 +2099,13 @@ mymain(void) DO_TEST_FULL("usb-controller-default-fallback-mac99ppc", ".ppc-latest", ARG_CAPS_ARCH, "ppc", ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-default-unavailable-mac99ppc", ".ppc-latest", ARG_CAPS_ARCH, "ppc", ARG_CAPS_VER, "latest", ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, - 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_QEMU_CAPS_DEL, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PCI_OHCI, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-default-fallback-powernv9", ".ppc64-latest", -- 2.50.1

On Tue, Aug 19, 2025 at 18:22:34 +0200, Andrea Bolognani via Devel wrote:
At this point the USB controller model selection logic is mostly sane, but there are still a few remaining oddities.
First of all, piix3-uhci (USB1) is used in way too many contexts, either as default or fallback choice, while it really should be relegated to x86 guests only.
Additionally, we're explicitly defaulting to pci-ohci (USB1) for a couple of Arm machine types, and limiting the default of qemu-xhci (USB3) to aarch64 only instead of using it for 32-bit guests as well.
Address all of the aforementioned quirks. The result is a reasonably consistent experience across architectures, with USB3 generally being used whenever available, Intel-specific USB controllers only showing up in x86 guests, and pci-ohci acting as the vaguely reasonable falllback across the board.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 28 ++++++++----------- ...iew-minimal.aarch64-latest.abi-update.args | 2 +- ...view-minimal.aarch64-latest.abi-update.xml | 2 +- ...rch64-realview-minimal.aarch64-latest.args | 2 +- ...arch64-realview-minimal.aarch64-latest.xml | 2 +- ...lepb-minimal.armv7l-latest.abi-update.args | 2 +- ...ilepb-minimal.armv7l-latest.abi-update.xml | 2 +- ...v7l-versatilepb-minimal.armv7l-latest.args | 2 +- ...mv7l-versatilepb-minimal.armv7l-latest.xml | 2 +- tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args | 2 +- tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml | 2 +- ...c-mac99-minimal.ppc-latest.abi-update.args | 2 +- ...pc-mac99-minimal.ppc-latest.abi-update.xml | 2 +- .../ppc-mac99-minimal.ppc-latest.args | 2 +- .../ppc-mac99-minimal.ppc-latest.xml | 2 +- .../ppce500-serial.ppc-latest.args | 2 +- .../ppce500-serial.ppc-latest.xml | 2 +- ...ler-automatic-realview.aarch64-latest.args | 2 +- ...ller-automatic-realview.aarch64-latest.xml | 2 +- ...r-automatic-versatilepb.armv7l-latest.args | 2 +- ...er-automatic-versatilepb.armv7l-latest.xml | 2 +- ...ault-fallback-realview.aarch64-latest.args | 2 +- ...fault-fallback-realview.aarch64-latest.xml | 2 +- ...ontroller-default-mac99ppc.ppc-latest.args | 2 +- ...controller-default-mac99ppc.ppc-latest.xml | 2 +- ...ler-default-versatilepb.armv7l-latest.args | 2 +- ...ller-default-versatilepb.armv7l-latest.xml | 2 +- tests/qemuxmlconftest.c | 16 +++++------ 28 files changed, 46 insertions(+), 50 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index df64ddbec1..2c7d91f597 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4334,7 +4334,7 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; }
- if (def->os.arch == VIR_ARCH_AARCH64) { + if (ARCH_IS_ARM(def->os.arch)) { /* Prefer USB3 */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; @@ -4366,14 +4366,17 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; }
- /* The default USB controller is piix3-uhci (USB1) if available. - * This choice is a fairly poor one, rooted primarily in - * historical reasons; thankfully, in most cases we will have - * picked a much more reasonable value before ever getting here */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) - return VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; - else if (!ARCH_IS_X86(def->os.arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + if (ARCH_IS_X86(def->os.arch)) { + /* Use piix3-uhci (USB1) for backwards compatibility */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) + return VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; + } + + /* Most common architectures and machine types have been already + * handled above; for the remaining cases, pci-ohci (USB1) is a + * sensible enough fallback */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI;
return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT;
This hunk is partially what I'd want to see in patch 26 (making x86 a separate case with explicit logic).
@@ -4425,13 +4428,6 @@ qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, } }
- if (ARCH_IS_ARM(def->os.arch)) { - if (STREQ(def->os.machine, "versatilepb") || - STRPREFIX(def->os.machine, "realview-eb")) - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; - } - return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; }
[...]
diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args index a05a413290..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \
This change seems to have happened also in code paths not allowing ABI update at least according to the filename.
-audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml index 7b21b24927..a9da2a3b13 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml @@ -17,7 +17,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-armv7l</emulator> - <controller type='usb' index='0' model='pci-ohci'> + <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args index 8032ad7f0e..bdc86620c8 100644 --- a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args +++ b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -initrd /media/ram/ramdisk \ -append 'root=/dev/ram rw console=ttyS0,115200' \ -dtb /media/ram/test.dtb \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -chardev pty,id=charserial0 \ -serial chardev:charserial0 \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml index 400f749eb0..31fcc3d053 100644 --- a/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml +++ b/tests/qemuxmlconfdata/ppc-dtb.ppc-latest.xml @@ -18,7 +18,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> diff --git a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args index 8600eec328..9c7c884c83 100644 --- a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args +++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -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 \ diff --git a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml index 215c196fbf..633aa684da 100644 --- a/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml @@ -14,7 +14,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'>
I think I need to think about this a bit more. I agree that the controller we picked didn't make sense for this machine, but in cases when it did work (e.g. when you run linux with the proper driver) you get something which doesn't resemble real hardware but likely works better than 'pci-ohci'. So I'm not sure about the downgrade in this case, although we're unlikely to break anything that'd be used widely in this case, breaking it would go against our philosophy

On Fri, Sep 19, 2025 at 11:39:05AM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:34 +0200, Andrea Bolognani via Devel wrote:
+++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \
This change seems to have happened also in code paths not allowing ABI update at least according to the filename.
It only affects domains for which a model was not picked in the past. So effectively only new domains, regardless of the flags. Existing domains will keep using whatever model they're configured to use.
+++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml @@ -14,7 +14,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'>
I think I need to think about this a bit more. I agree that the controller we picked didn't make sense for this machine, but in cases when it did work (e.g. when you run linux with the proper driver) you get something which doesn't resemble real hardware but likely works better than 'pci-ohci'.
So I'm not sure about the downgrade in this case, although we're unlikely to break anything that'd be used widely in this case, breaking it would go against our philosophy
Is pci-ohci really a downgrade compared to piix3-uhci? They're both USB1 controllers. They should both have wide driver support and provide basic USB functionality. One just looks silly for non-x86 machines. Plus as mentioned above existing guests will retain the existing model, so no actual breakage will happen. -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Sep 19, 2025 at 10:34:39 -0500, Andrea Bolognani wrote:
On Fri, Sep 19, 2025 at 11:39:05AM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:34 +0200, Andrea Bolognani via Devel wrote:
+++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \
This change seems to have happened also in code paths not allowing ABI update at least according to the filename.
It only affects domains for which a model was not picked in the past. So effectively only new domains, regardless of the flags. Existing domains will keep using whatever model they're configured to use.
Beware that we historically considered also virDomainCreateXML (transient wit possibly not fully filled XML) to be compatible across runs. I know that we already didn't obey this in some cases but we should consider this every time. Especially in case of these limited boards the hardware you'd normally built in will certainly not be XHCI
+++ b/tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml @@ -14,7 +14,7 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc</emulator> - <controller type='usb' index='0' model='piix3-uhci'> + <controller type='usb' index='0' model='pci-ohci'>
I think I need to think about this a bit more. I agree that the controller we picked didn't make sense for this machine, but in cases when it did work (e.g. when you run linux with the proper driver) you get something which doesn't resemble real hardware but likely works better than 'pci-ohci'.
So I'm not sure about the downgrade in this case, although we're unlikely to break anything that'd be used widely in this case, breaking it would go against our philosophy
Is pci-ohci really a downgrade compared to piix3-uhci? They're both USB1 controllers. They should both have wide driver support and provide basic USB functionality. One just looks silly for non-x86 machines.
Uh, yeah. I somehow thought this was 'ehci'/usb2.
Plus as mentioned above existing guests will retain the existing model, so no actual breakage will happen.
See above.

On Fri, Sep 19, 2025 at 07:00:17PM +0200, Peter Krempa wrote:
On Fri, Sep 19, 2025 at 10:34:39 -0500, Andrea Bolognani wrote:
On Fri, Sep 19, 2025 at 11:39:05AM +0200, Peter Krempa wrote:
On Tue, Aug 19, 2025 at 18:22:34 +0200, Andrea Bolognani via Devel wrote:
+++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \
This change seems to have happened also in code paths not allowing ABI update at least according to the filename.
It only affects domains for which a model was not picked in the past. So effectively only new domains, regardless of the flags. Existing domains will keep using whatever model they're configured to use.
Beware that we historically considered also virDomainCreateXML (transient wit possibly not fully filled XML) to be compatible across runs. I know that we already didn't obey this in some cases but we should consider this every time.
Fair point. I feel that the actual impact on users is going to be basically zero in this case, so I'm inclined to focus more on reaching well-defined, reasonably consistent behavior across the board that's implemented in a maintainable manner rather than necessarily preserving the existing behavior for all niche machine types in all niche scenarios.
Especially in case of these limited boards the hardware you'd normally built in will certainly not be XHCI
I'd be fine using pci-ohci as the baseline for everything that is not one of the "explicitly supported" machines (that is, virt across architectures, i440fx and q35 on x86, pseries on ppc64 and s390-ccw-virtio on s390x). That's pretty much exactly how things look once this series has been applied. In this case, however, I'm simply extending the existing default for 64-bit Arm machines to 32-bit ones. I don't think it makes sense to differentiate the model based on the number of bits - QEMU doesn't. So either we downgrade the 64-bit machines or upgrade the 32-bit ones. Looking at what QEMU does, the default for this machine type is pci-ohci. So I'd say let's go with that. -- Andrea Bolognani / Red Hat / Virtualization

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- NEWS.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index f6f370383b..b51c2dde5a 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -24,6 +24,12 @@ v11.7.0 (unreleased) * **Improvements** + * qemu: Improvements to USB controller model selection + + Virtualization-friendly USB3 controllers are now used in more situations, + Intel-specific USB controllers are relegated to x86 guests, and model + selection overall behaves more consistently across architectures. + * **Bug fixes** -- 2.50.1

On 8/19/25 18:22, Andrea Bolognani via Devel wrote:
Just like the series dealing with [SCSI] from last month, this is an effort to complete work that I had started in early 2024 ([v2], [v1]) and then promptly forgot about.
Dealing with USB controllers is a lot easier compared to a year and a half ago because Peter has already brought some much-needed sanity to their handling in the meantime, including finally removing all uses of -usb, but there's still room for improvement.
Looking at USB controllers made me realize that we were doing things incorrectly or suboptimally on the PCI side as well, so there are a number of changes in that part of libvirt too.
Since USB controllers are PCI devices, some of the changes in one area directly affect the other one and it would have been challening to separate these patches into two smaller series in a way that would make sense, so unfortunately you get a single big one instead. Sorry.
[SCSI] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/AL6GJ... [v2] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/FZ6BT... [v1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/G53MR...
Andrea Bolognani (31): tests: Fix typo in usb-controller-nec-xhci-autoassign tests: Drop coverage for versatilepb on aarch64 tests: Don't use memballoon=none for minimal tests tests: Don't set PCI address in usb-controller-default tests tests: Minimize usb-controller tests tests: Rename usb-controller-implicit-* tests: Expand coverage for automatic/default USB controllers tests: Fix some usb-controller-*-unavailable cases qemu: Check for pci-ohci availability tests: Use realview-eb instead of realview-pbx-a9 qemu: Fix PCI/USB handling for Arm realview boards tests: Add coverage for PCI use with isapc qemu: Don't add memballoon to isapc qemu: Introduce qemuDomainNetIsPCI() qemu: Prevent use of PCI devices when PCI is not supported qemu: Validate presence of PCI support qemu: Update qemuDomainSupportsPCI() qemu: Add sanity checks for auto-added PCI and USB controllers qemu: Ensure USB controllers have a PCI address assigned qemu: Always default to no USB controller on s390x qemu: Drop skip for USB controllers on s390x qemu: Fold check into qemuBuildSkipController() qemu: Validate USB controllers earlier qemu: Add qemuDomainDefaultUSBControllerModel() qemu: Add qemuDomainDefaultUSBControllerModelAutoAdded() qemu: Clean up qemuDomainDefaultUSBControllerModel() qemu: Use qemu-xhci by default on RISC-V qemu: Allow nec-xhci as fallback for modern architectures qemu: Remove fallback to piix3-uhci for Arm virt guests qemu: Finish cleaning up qemuDomainDefaultUSBControllerModel() news: Update for USB controller model selection improvements
206 files changed, 897 insertions(+), 1601 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal

On Wed, Aug 20, 2025 at 02:39:11PM +0200, Michal Prívozník wrote:
On 8/19/25 18:22, Andrea Bolognani via Devel wrote:
Just like the series dealing with [SCSI] from last month, this is an effort to complete work that I had started in early 2024 ([v2], [v1]) and then promptly forgot about.
Dealing with USB controllers is a lot easier compared to a year and a half ago because Peter has already brought some much-needed sanity to their handling in the meantime, including finally removing all uses of -usb, but there's still room for improvement.
Looking at USB controllers made me realize that we were doing things incorrectly or suboptimally on the PCI side as well, so there are a number of changes in that part of libvirt too.
Since USB controllers are PCI devices, some of the changes in one area directly affect the other one and it would have been challening to separate these patches into two smaller series in a way that would make sense, so unfortunately you get a single big one instead. Sorry.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Thank you. I'll hold off from merging until the 11.8.0 development cycle starts, just to be on the safe side. That will also give Peter and others a chance to have a look. -- Andrea Bolognani / Red Hat / Virtualization
participants (5)
-
Andrea Bolognani
-
Boris Fiuczynski
-
Michal Prívozník
-
Peter Krempa
-
Thomas Huth