From: Andrea Bolognani Date: Mon, 22 Sep 2025 13:09:29 +0000 (+0200) Subject: qemu: Don't add PCI, USB or memballoon to microvm X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c60d168605dffeb1ad17398328efd9456435def8;p=thirdparty%2Flibvirt.git qemu: Don't add PCI, USB or memballoon to microvm The microvm machine type doesn't support PCI, so adding PCI controllers to it doesn't make sense, nor does adding a USB controller or a memballon since both are PCI devices. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index ab39dfe138..d5708fbff9 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1252,7 +1252,8 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, switch (def->os.arch) { case VIR_ARCH_I686: case VIR_ARCH_X86_64: - if (STREQ(def->os.machine, "isapc")) { + if (STREQ(def->os.machine, "isapc") || + STREQ(def->os.machine, "microvm")) { break; } diff --git a/tests/qemuxmlconfdata/microvm-pci.x86_64-latest.args b/tests/qemuxmlconfdata/microvm-pci.x86_64-latest.args index 33bbaacd7c..06598ddcbc 100644 --- a/tests/qemuxmlconfdata/microvm-pci.x86_64-latest.args +++ b/tests/qemuxmlconfdata/microvm-pci.x86_64-latest.args @@ -26,8 +26,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -rtc base=utc \ -no-shutdown \ -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/microvm-pci.x86_64-latest.xml b/tests/qemuxmlconfdata/microvm-pci.x86_64-latest.xml index 1cac541367..06b5a8b789 100644 --- a/tests/qemuxmlconfdata/microvm-pci.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/microvm-pci.x86_64-latest.xml @@ -18,12 +18,6 @@ /usr/bin/qemu-system-x86_64 - -
-