On 10/12/26 13:20, Magnus Kulke wrote:
This test asserts that the vhost-net commandline is generated for KVM and MSHV accelerator options.
$ VIR_TEST_RANGE=2-10 VIR_TEST_DEBUG=1 meson test -C build \ --verbose qemucommandutiltest
TEST: qemucommandutiltest 2) KVM vhost ... OK 3) KVM vhost multiqueue ... OK 4) MSHV vhost ... OK 5) MSHV vhost multiqueue ... OK 6) MSHV default ... OK 7) MSHV qemu backend ... OK 8) TCG vhost ... OK 9) MSHV vhost unavailable ... OK 10) MSHV default unavailable ... OK
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com> --- tests/qemucommandutiltest.c | 128 ++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+)
I see where you're coming from, but this is not the correct test. This should be another test case (or an existing one modified) to qemuxmlconftest. There, mocking is used, i.e. there's an alternative implementation of qemuInterfaceOpenVhostNet() that's used from the test binary. Unfortunately, the alternative implementation does not honor the check from 1/2. We have two options here: 1) I'll merge just your first patch, or 2) I'll post patches to make test suite have the same check as the production code, and you'll rebase your patches on top. NB: In my review, I did the following change to demonstrate 1/2 works as expected: diff --git i/tests/qemuxmlconfdata/mshv-x86_64-q35-headless.xml w/tests/qemuxmlconfdata/mshv-x86_64-q35-headless.xml index d8fc60a212..f8e46c30c7 100644 --- i/tests/qemuxmlconfdata/mshv-x86_64-q35-headless.xml +++ w/tests/qemuxmlconfdata/mshv-x86_64-q35-headless.xml @@ -27,6 +27,11 @@ <source file='/var/lib/libvirt/images/test.qcow2'/> <target dev='vda' bus='virtio'/> </disk> + <interface type='ethernet'> + <mac address='52:54:00:e5:48:5a'/> + <model type='virtio'/> + <driver name='vhost' ioeventfd='on' queues='5'/> + </interface> <console type='pty'/> <rng model='virtio'> <backend model='random'>/dev/urandom</backend> Michal