From: Peter Krempa <[email protected]>

Signed-off-by: Peter Krempa <[email protected]>
---
 tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args       | 2 +-
 tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args          | 2 +-
 .../iommufd-virt-pci-bus-single.aarch64-latest.args           | 2 +-
 tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args        | 4 ++--
 tests/qemuxmlconfdata/iommufd.x86_64-latest.args              | 2 +-
 tests/qemuxmlconftest.c                                       | 3 +--
 6 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args 
b/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args
index bf4ee71d7a..463192fbff 100644
--- a/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args
@@ -36,6 +36,6 @@ 
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \
 -global ICH9-LPC.noreboot=off \
 -watchdog-action reset \
 -object '{"qom-type":"iommufd","id":"iommufd0","fd":"@iommu-0@-dup"}' \
--device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","bus":"pcie.0","addr":"0x3"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"@hostdev-hostdev0-fd@","bus":"pcie.0","addr":"0x3"}'
 \
 -sandbox 
on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args 
b/tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args
index 730855afe1..22c811bfb7 100644
--- a/tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args
@@ -36,6 +36,6 @@ 
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \
 -global ICH9-LPC.noreboot=off \
 -watchdog-action reset \
 -object '{"qom-type":"iommufd","id":"iommufd0","fd":"XXXXXXX"}' \
--device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","bus":"pcie.0","addr":"0x3"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"@hostdev-hostdev0-fd@","bus":"pcie.0","addr":"0x3"}'
 \
 -sandbox 
on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git 
a/tests/qemuxmlconfdata/iommufd-virt-pci-bus-single.aarch64-latest.args 
b/tests/qemuxmlconfdata/iommufd-virt-pci-bus-single.aarch64-latest.args
index e92b7b44fd..9c04fb6523 100644
--- a/tests/qemuxmlconfdata/iommufd-virt-pci-bus-single.aarch64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-virt-pci-bus-single.aarch64-latest.args
@@ -27,6 +27,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -boot strict=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -object '{"qom-type":"iommufd","id":"iommufd0","fd":"XXXXXXX"}' \
--device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","bus":"pcie.0","addr":"0x1"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"@hostdev-hostdev0-fd@","bus":"pcie.0","addr":"0x1"}'
 \
 -sandbox 
on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args 
b/tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args
index 6719b771c4..659ac65eee 100644
--- a/tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args
@@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -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":"XXXXXXX"}' \
--device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","bus":"pci.1","addr":"0x0"}'
 \
--device 
'{"driver":"vfio-pci","id":"hostdev1","iommufd":"iommufd0","fd":"XXXXXXX","bus":"pci.2","addr":"0x0"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"@hostdev-hostdev0-fd@","bus":"pci.1","addr":"0x0"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev1","iommufd":"iommufd0","fd":"@hostdev-hostdev1-fd@","bus":"pci.2","addr":"0x0"}'
 \
 -sandbox 
on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxmlconfdata/iommufd.x86_64-latest.args 
b/tests/qemuxmlconfdata/iommufd.x86_64-latest.args
index 8ee6b97615..e04b4e5836 100644
--- a/tests/qemuxmlconfdata/iommufd.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd.x86_64-latest.args
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -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":"XXXXXXX"}' \
--device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","bus":"pci.0","addr":"0x3"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"@hostdev-hostdev0-fd@","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 \
 -msg timestamp=on
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index c45701978c..e13347fe92 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -52,8 +52,7 @@ testQemuPrepareHostdevPCI(virDomainHostdevDef *hostdev)

     if (virHostdevIsPCIDeviceWithIOMMUFD(hostdev)) {
         g_autofree char *name = g_strdup_printf("hostdev-%s-fd", 
hostdev->info->alias);
-        /* Use a placeholder FD value for tests */
-        int vfioDeviceFD = 0;
+        int vfioDeviceFD = 
virTestMakeDummyFD(g_strdup_printf("@hostdev-%s-fd@", hostdev->info->alias));
         hostdevPriv->vfioDeviceFd = qemuFDPassDirectNew(name, &vfioDeviceFD);
     }
 }
-- 
2.54.0

Reply via email to