From: Peter Krempa <[email protected]>

Install the handler to stabilize output files on '-object' with
'iommufd' qom type which references a FD directly via the 'fd' property.

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         | 2 +-
 tests/qemuxmlconfdata/iommufd.x86_64-latest.args               | 2 +-
 tests/qemuxmlconftest.c                                        | 3 ++-
 6 files changed, 7 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 e95eab8d07..f88e019770 100644
--- a/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-q35-fd.x86_64-latest.args
@@ -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":"20"}' \
+-object '{"qom-type":"iommufd","id":"iommufd0","fd":"XXXXXXX"}' \
 -device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"0","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 e90f3a20e1..f88e019770 100644
--- a/tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-q35.x86_64-latest.args
@@ -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":"0"}' \
+-object '{"qom-type":"iommufd","id":"iommufd0","fd":"XXXXXXX"}' \
 -device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"0","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 ac408b6b32..28d8a47c31 100644
--- a/tests/qemuxmlconfdata/iommufd-virt-pci-bus-single.aarch64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-virt-pci-bus-single.aarch64-latest.args
@@ -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":"0"}' \
+-object '{"qom-type":"iommufd","id":"iommufd0","fd":"XXXXXXX"}' \
 -device 
'{"driver":"vfio-pci","id":"hostdev0","iommufd":"iommufd0","fd":"0","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 d472bd6144..e910ccc760 100644
--- a/tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd-virt.aarch64-latest.args
@@ -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":"0"}' \
+-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"}'
 \
 -sandbox 
on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
diff --git a/tests/qemuxmlconfdata/iommufd.x86_64-latest.args 
b/tests/qemuxmlconfdata/iommufd.x86_64-latest.args
index 8e93539c9e..f7e53ac388 100644
--- a/tests/qemuxmlconfdata/iommufd.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/iommufd.x86_64-latest.args
@@ -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":"0"}' \
+-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":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
 -sandbox 
on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 653cdb4012..bbced4815a 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -525,7 +525,8 @@ testCompareXMLToArgvStabilizeArgs(virCommand *cmd,
             break;

         if (STREQ(args[a], "-add-fd") ||
-            STREQ(args[a], "-chardev")) {
+            STREQ(args[a], "-chardev") ||
+            (STREQ(args[a], "-object") && STRPREFIX(args[a + 1], 
"{\"qom-type\":\"iommufd\""))) {
             testCompareXMLToArgvStabilizeOne(&args[a + 1], "fd", fdsubsts, 
false);

             /* qemuxmlconftest also tests the JSON syntax which isn't 
supported via
-- 
2.54.0

Reply via email to