]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Prevent use of PCI devices when PCI is not supported
authorAndrea Bolognani <abologna@redhat.com>
Wed, 9 Jul 2025 15:57:24 +0000 (17:57 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Oct 2025 09:15:41 +0000 (11:15 +0200)
commitfa4655495786ff102175ab23c730ac21365a5ff6
treeb5ca6682cf455cd2709437d7127ed3052d6cca2e
parenta66db764471dece3725f99ac47983b25a697f5f1
qemu: Prevent use of PCI devices when PCI is not supported

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>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain_address.c
tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args [deleted file]
tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml [deleted file]
tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml [deleted symlink]
tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.abi-update.err [new file with mode: 0644]
tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args [deleted file]
tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.err [new file with mode: 0644]
tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.err [deleted file]
tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml [deleted file]
tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml [deleted symlink]
tests/qemuxmlconftest.c