From: Peter Krempa <[email protected]> Install hanlder to stabilize 'vhostfd' fds in -device so that we can later switch tests to use real FDs.
Signed-off-by: Peter Krempa <[email protected]> --- tests/qemuxmlconfdata/vhost-vsock-auto.x86_64-latest.args | 2 +- .../qemuxmlconfdata/vhost-vsock-ccw-auto.s390x-latest.args | 2 +- .../qemuxmlconfdata/vhost-vsock-ccw-iommu.s390x-latest.args | 2 +- tests/qemuxmlconfdata/vhost-vsock-ccw.s390x-latest.args | 2 +- tests/qemuxmlconfdata/vhost-vsock.x86_64-latest.args | 2 +- .../virtio-non-transitional.x86_64-latest.args | 2 +- .../qemuxmlconfdata/virtio-transitional.x86_64-latest.args | 2 +- tests/qemuxmlconftest.c | 6 ++++++ 8 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/qemuxmlconfdata/vhost-vsock-auto.x86_64-latest.args b/tests/qemuxmlconfdata/vhost-vsock-auto.x86_64-latest.args index d16eabdd90..b3f2e06c72 100644 --- a/tests/qemuxmlconfdata/vhost-vsock-auto.x86_64-latest.args +++ b/tests/qemuxmlconfdata/vhost-vsock-auto.x86_64-latest.args @@ -30,5 +30,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x6"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-pci","id":"vsock0","guest-cid":42,"vhostfd":"6789","bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"vhost-vsock-pci","id":"vsock0","guest-cid":42,"vhostfd":"XXXXXXX","bus":"pci.0","addr":"0x2"}' \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/vhost-vsock-ccw-auto.s390x-latest.args b/tests/qemuxmlconfdata/vhost-vsock-ccw-auto.s390x-latest.args index 05b7f64523..ccc7152713 100644 --- a/tests/qemuxmlconfdata/vhost-vsock-ccw-auto.s390x-latest.args +++ b/tests/qemuxmlconfdata/vhost-vsock-ccw-auto.s390x-latest.args @@ -31,5 +31,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-ccw","id":"vsock0","guest-cid":42,"vhostfd":"6789","devno":"fe.0.0002"}' \ +-device '{"driver":"vhost-vsock-ccw","id":"vsock0","guest-cid":42,"vhostfd":"XXXXXXX","devno":"fe.0.0002"}' \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/vhost-vsock-ccw-iommu.s390x-latest.args b/tests/qemuxmlconfdata/vhost-vsock-ccw-iommu.s390x-latest.args index ec0f06e2f4..a83ab0cc4b 100644 --- a/tests/qemuxmlconfdata/vhost-vsock-ccw-iommu.s390x-latest.args +++ b/tests/qemuxmlconfdata/vhost-vsock-ccw-iommu.s390x-latest.args @@ -31,5 +31,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-ccw","iommu_platform":true,"id":"vsock0","guest-cid":4,"vhostfd":"6789","devno":"fe.0.0002"}' \ +-device '{"driver":"vhost-vsock-ccw","iommu_platform":true,"id":"vsock0","guest-cid":4,"vhostfd":"XXXXXXX","devno":"fe.0.0002"}' \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/vhost-vsock-ccw.s390x-latest.args b/tests/qemuxmlconfdata/vhost-vsock-ccw.s390x-latest.args index 04c97134a4..3552cf18b6 100644 --- a/tests/qemuxmlconfdata/vhost-vsock-ccw.s390x-latest.args +++ b/tests/qemuxmlconfdata/vhost-vsock-ccw.s390x-latest.args @@ -31,5 +31,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-ccw","id":"vsock0","guest-cid":4,"vhostfd":"6789","devno":"fe.0.0003"}' \ +-device '{"driver":"vhost-vsock-ccw","id":"vsock0","guest-cid":4,"vhostfd":"XXXXXXX","devno":"fe.0.0003"}' \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/vhost-vsock.x86_64-latest.args b/tests/qemuxmlconfdata/vhost-vsock.x86_64-latest.args index fcc1b74bd0..e26677052b 100644 --- a/tests/qemuxmlconfdata/vhost-vsock.x86_64-latest.args +++ b/tests/qemuxmlconfdata/vhost-vsock.x86_64-latest.args @@ -30,5 +30,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x6"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-pci","id":"vsock0","guest-cid":4,"vhostfd":"6789","bus":"pci.0","addr":"0x7"}' \ +-device '{"driver":"vhost-vsock-pci","id":"vsock0","guest-cid":4,"vhostfd":"XXXXXXX","bus":"pci.0","addr":"0x7"}' \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/virtio-non-transitional.x86_64-latest.args b/tests/qemuxmlconfdata/virtio-non-transitional.x86_64-latest.args index 955390e23b..0701791d47 100644 --- a/tests/qemuxmlconfdata/virtio-non-transitional.x86_64-latest.args +++ b/tests/qemuxmlconfdata/virtio-non-transitional.x86_64-latest.args @@ -52,5 +52,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"}' \ -device '{"driver":"virtio-rng-pci-non-transitional","rng":"objrng0","id":"rng0","bus":"pci.8","addr":"0x0"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-pci-non-transitional","id":"vsock0","guest-cid":4,"vhostfd":"6789","bus":"pci.9","addr":"0x0"}' \ +-device '{"driver":"vhost-vsock-pci-non-transitional","id":"vsock0","guest-cid":4,"vhostfd":"XXXXXXX","bus":"pci.9","addr":"0x0"}' \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/virtio-transitional.x86_64-latest.args b/tests/qemuxmlconfdata/virtio-transitional.x86_64-latest.args index e54eea6164..8963b6c986 100644 --- a/tests/qemuxmlconfdata/virtio-transitional.x86_64-latest.args +++ b/tests/qemuxmlconfdata/virtio-transitional.x86_64-latest.args @@ -45,5 +45,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"}' \ -device '{"driver":"virtio-rng-pci-transitional","rng":"objrng0","id":"rng0","bus":"pci.2","addr":"0x8"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --device '{"driver":"vhost-vsock-pci-transitional","id":"vsock0","guest-cid":4,"vhostfd":"6789","bus":"pci.2","addr":"0x9"}' \ +-device '{"driver":"vhost-vsock-pci-transitional","id":"vsock0","guest-cid":4,"vhostfd":"XXXXXXX","bus":"pci.2","addr":"0x9"}' \ -msg timestamp=on diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index bbced4815a..a6f2a3a19e 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -536,6 +536,12 @@ testCompareXMLToArgvStabilizeArgs(virCommand *cmd, testCompareXMLToArgvStabilizeOne(&args[a + 1], "str", fdsubsts, true); } + a++; + } else if (STREQ(args[a], "-device")) { + if (STRPREFIX(args[a + 1], "{\"driver\":\"vhost-vsock-")) { + testCompareXMLToArgvStabilizeOne(&args[a + 1], "vhostfd", fdsubsts, false); + } + a++; } } -- 2.54.0
