From: Peter Krempa <[email protected]>

Prepare to use real FDs in tests.

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                                       | 2 ++
 6 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args 
b/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args
index f88e019770..730855afe1 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":"XXXXXXX"}' \
--device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"0","bus":"pcie.0","addr":"0x3"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","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 f88e019770..730855afe1 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":"0","bus":"pcie.0","addr":"0x3"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","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 28d8a47c31..e92b7b44fd 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":"0","bus":"pcie.0","addr":"0x1"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","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 e910ccc760..6719b771c4 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":"0","bus":"pci.1","addr":"0x0"}'
 \
--device 
'{"driver":"vfio-pci","id":"hostdev1","iommufd":"iommufd0","fd":"0","bus":"pci.2","addr":"0x0"}'
 \
+-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"}'
 \
 -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 f7e53ac388..8ee6b97615 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":"0","bus":"pci.0","addr":"0x3"}'
 \
+-device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"XXXXXXX","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 0b0bcdea92..6ccafcde0e 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -540,6 +540,8 @@ testCompareXMLToArgvStabilizeArgs(virCommand *cmd,
         } else if (STREQ(args[a], "-device")) {
             if (STRPREFIX(args[a + 1], "{\"driver\":\"vhost-vsock-")) {
                 testCompareXMLToArgvStabilizeOne(&args[a + 1], "vhostfd", 
fdsubsts, false);
+            } else if (STRPREFIX(args[a + 1], "{\"driver\":\"vfio-pci\"")) {
+                testCompareXMLToArgvStabilizeOne(&args[a + 1], "fd", fdsubsts, 
false);
             }

             a++;
-- 
2.54.0

Reply via email to