]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxmlconftest: Set fake FD for IOMMUFD
authorPavel Hrdina <phrdina@redhat.com>
Sat, 14 Feb 2026 16:11:44 +0000 (17:11 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 16 Feb 2026 14:50:39 +0000 (15:50 +0100)
Same as for VFIO FD for host device.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args
tests/qemuxmlconfdata/iommufd-virt-pci-bus-single.aarch64-latest.args
tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args
tests/qemuxmlconfdata/iommufd.x86_64-latest.args
tests/qemuxmlconftest.c

index 7d819e141bc3aa7e17760660dd1f06d48d8c9be2..d5fe7040219071558502dc9b334bcdf9172a9d43 100644 (file)
@@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \
 -device '{"driver":"qxl-vga","id":"video0","max_outputs":1,"ram_size":67108864,"vram_size":33554432,"vram64_size_mb":0,"vgamem_mb":8,"bus":"pcie.0","addr":"0x1"}' \
 -global ICH9-LPC.noreboot=off \
 -watchdog-action reset \
--object '{"qom-type":"iommufd","id":"iommufd0","fd":"-1"}' \
+-object '{"qom-type":"iommufd","id":"iommufd0","fd":"0"}' \
 -device '{"driver":"vfio-pci","host":"0000:06:12.5","id":"hostdev0","iommufd":"iommufd0","fd":"0","bus":"pcie.0","addr":"0x3"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 9a04e9735159f99d8ca067161a0064342e99c5d0..303cfa922bd38991e9bc4f950b89504b0b4eaad0 100644 (file)
@@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -no-shutdown \
 -boot strict=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
--object '{"qom-type":"iommufd","id":"iommufd0","fd":"-1"}' \
+-object '{"qom-type":"iommufd","id":"iommufd0","fd":"0"}' \
 -device '{"driver":"vfio-pci","host":"0000:06:12.5","id":"hostdev0","iommufd":"iommufd0","fd":"0","bus":"pcie.0","addr":"0x1"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 039ae4477c68faa3a749c025f5f5472371308bb0..6a62b08e8a4721bb2e17a66042148fbe6e7ee3ee 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
 -device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--object '{"qom-type":"iommufd","id":"iommufd0","fd":"-1"}' \
+-object '{"qom-type":"iommufd","id":"iommufd0","fd":"0"}' \
 -device '{"driver":"vfio-pci","host":"0000:06:12.5","id":"hostdev0","iommufd":"iommufd0","fd":"0","bus":"pci.1","addr":"0x0"}' \
 -device '{"driver":"vfio-pci","host":"0000:07:12.5","id":"hostdev1","iommufd":"iommufd0","fd":"0","bus":"pci.2","addr":"0x0"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
index 3130ba2e3a691a826abae07feff7e96f3f007775..15dabe197c41cb098ea9de58df47abfd6753ddd8 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -boot strict=on \
 -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--object '{"qom-type":"iommufd","id":"iommufd0","fd":"-1"}' \
+-object '{"qom-type":"iommufd","id":"iommufd0","fd":"0"}' \
 -device '{"driver":"vfio-pci","host":"0000:06:12.5","id":"hostdev0","iommufd":"iommufd0","fd":"0","bus":"pci.0","addr":"0x3"}' \
 -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
index a04311647ec640d4ef4caa6317c291dff30e03a8..4ab004a95455c66e77eaf5ed3d1cb0cebf38d7a0 100644 (file)
@@ -388,6 +388,7 @@ testQemuPrepareHostdevUSB(virDomainHostdevDef *hostdev)
 static void
 testQemuPrepareHostdev(virDomainObj *vm)
 {
+    qemuDomainObjPrivate *priv = QEMU_DOMAIN_PRIVATE(vm);
     size_t i;
 
     for (i = 0; i < vm->def->nhostdevs; i++) {
@@ -410,6 +411,9 @@ testQemuPrepareHostdev(virDomainObj *vm)
             break;
         }
     }
+
+    if (virDomainDefHasPCIHostdevWithIOMMUFD(vm->def))
+        priv->iommufd = 0;
 }