From: Michal Privoznik <mprivozn@redhat.com> Inside of qemuxml2argvmock.c there's an alternative implementation of qemuInterfaceOpenVhostNet(). Fair enough. But the original function (living in qemu_interface.c) has a check which exits early from the function. This check is lacking in the mock which then leads qemuxmlconftest generate a different cmd line than the production code. The is particularly important, when the check is changed and we want to verify through tests that it doesn't break anything. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/qemuxml2argvmock.c | 7 ++++++- tests/qemuxmlconfdata/downscript.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/net-coalesce.x86_64-latest.args | 6 +++--- .../net-eth-unmanaged-tap.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/net-isolated-port.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/net-midonet.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/net-mtu.x86_64-latest.args | 4 ++-- .../net-virtio-network-portgroup.x86_64-latest.args | 2 +- .../net-virtio-teaming-network.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/net-virtio-vhost.x86_64-latest.args | 6 +++--- .../qemuxmlconfdata/tap-vhost-incorrect.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/tap-vhost.x86_64-latest.args | 2 +- 12 files changed, 22 insertions(+), 17 deletions(-) diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 4f47b2598e..7b211a191d 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -222,13 +222,18 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path G_GNUC_UNUSED, } int -qemuInterfaceOpenVhostNet(virDomainObj *vm G_GNUC_UNUSED, +qemuInterfaceOpenVhostNet(virDomainObj *vm, virDomainNetDef *net) { qemuDomainNetworkPrivate *netpriv = QEMU_DOMAIN_NETWORK_PRIVATE(net); size_t vhostfdSize = net->driver.virtio.queues; size_t i; + if (vm->def->virtType != VIR_DOMAIN_VIRT_KVM || + net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_QEMU) { + return 0; + } + if (!vhostfdSize) vhostfdSize = 1; diff --git a/tests/qemuxmlconfdata/downscript.x86_64-latest.args b/tests/qemuxmlconfdata/downscript.x86_64-latest.args index 6ee1d402b5..177b700f0f 100644 --- a/tests/qemuxmlconfdata/downscript.x86_64-latest.args +++ b/tests/qemuxmlconfdata/downscript.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"virtio-9p-pci","id":"fs0","fsdev":"fsdev-fs0","mount_tag":"fs1","bus":"pci.0","addr":"0x3"}' \ -fsdev local,security_model=mapped,id=fsdev-fs1,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs1","fsdev":"fsdev-fs1","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ --netdev '{"type":"tap","fd":"@tap-vnet0-fd@","vhost":true,"vhostfd":"@vhostfd-net0-fd@","id":"hostnet0"}' \ +-netdev '{"type":"tap","fd":"@tap-vnet0-fd@","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:f6:66:88","bus":"pci.0","addr":"0xb"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ diff --git a/tests/qemuxmlconfdata/net-coalesce.x86_64-latest.args b/tests/qemuxmlconfdata/net-coalesce.x86_64-latest.args index 688a19f91a..30a6cfcc87 100644 --- a/tests/qemuxmlconfdata/net-coalesce.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-coalesce.x86_64-latest.args @@ -33,11 +33,11 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -device '{"driver":"virtio-blk-pci","event_idx":true,"bus":"pci.0","addr":"0x4","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":2}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso","node-name":"libvirt-1-storage","read-only":true}' \ -device '{"driver":"ide-cd","bus":"ide.1","unit":0,"drive":"libvirt-1-storage","id":"ide0-1-0","bootindex":1}' \ --netdev '{"type":"tap","fd":"@iface-net0-fd@","vhost":true,"vhostfd":"@vhostfd-net0-fd@","id":"hostnet0"}' \ +-netdev '{"type":"tap","fd":"@iface-net0-fd@","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:e5:48:58","bus":"pci.0","addr":"0x2"}' \ --netdev '{"type":"tap","fd":"@iface-net1-fd@","vhost":true,"vhostfd":"@vhostfd-net1-fd@","id":"hostnet1"}' \ +-netdev '{"type":"tap","fd":"@iface-net1-fd@","id":"hostnet1"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"52:54:00:e5:48:59","bus":"pci.0","addr":"0x3"}' \ --netdev '{"type":"tap","fd":"@iface-net2-fd@","vhost":true,"vhostfd":"@vhostfd-net2-fd@","id":"hostnet2"}' \ +-netdev '{"type":"tap","fd":"@iface-net2-fd@","id":"hostnet2"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet2","id":"net2","mac":"52:54:00:e5:48:60","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ diff --git a/tests/qemuxmlconfdata/net-eth-unmanaged-tap.x86_64-latest.args b/tests/qemuxmlconfdata/net-eth-unmanaged-tap.x86_64-latest.args index 902b70d17f..2cc2e53dc4 100644 --- a/tests/qemuxmlconfdata/net-eth-unmanaged-tap.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-eth-unmanaged-tap.x86_64-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-storage","id":"ide0-0-0","bootindex":1}' \ --netdev '{"type":"tap","fd":"@tap-mytap0-fd@","vhost":true,"vhostfd":"@vhostfd-net0-fd@","id":"hostnet0"}' \ +-netdev '{"type":"tap","fd":"@tap-mytap0-fd@","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"fe:11:22:33:44:55","bus":"pci.0","addr":"0x2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxmlconfdata/net-isolated-port.x86_64-latest.args b/tests/qemuxmlconfdata/net-isolated-port.x86_64-latest.args index fcb202cd23..4f2833ca69 100644 --- a/tests/qemuxmlconfdata/net-isolated-port.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-isolated-port.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \ -device '{"driver":"qemu-xhci","id":"usb","bus":"pci.2","addr":"0x0"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","drive":"libvirt-1-storage","id":"sata0-0-0","bootindex":1}' \ --netdev '{"type":"tap","fd":"@iface-net0-fd@","vhost":true,"vhostfd":"@vhostfd-net0-fd@","id":"hostnet0"}' \ +-netdev '{"type":"tap","fd":"@iface-net0-fd@","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d6:c0:0b","bus":"pci.1","addr":"0x0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -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"}' \ diff --git a/tests/qemuxmlconfdata/net-midonet.x86_64-latest.args b/tests/qemuxmlconfdata/net-midonet.x86_64-latest.args index 13bc83b4cb..f87a2df60c 100644 --- a/tests/qemuxmlconfdata/net-midonet.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-midonet.x86_64-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-storage","id":"ide0-0-0","bootindex":1}' \ --netdev '{"type":"tap","fd":"@iface-net0-fd@","vhost":true,"vhostfd":"@vhostfd-net0-fd@","id":"hostnet0"}' \ +-netdev '{"type":"tap","fd":"@iface-net0-fd@","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.0","addr":"0x2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ diff --git a/tests/qemuxmlconfdata/net-mtu.x86_64-latest.args b/tests/qemuxmlconfdata/net-mtu.x86_64-latest.args index 922552cd8b..51f5d8383c 100644 --- a/tests/qemuxmlconfdata/net-mtu.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-mtu.x86_64-latest.args @@ -33,9 +33,9 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -device '{"driver":"virtio-blk-pci","event_idx":true,"bus":"pci.0","addr":"0x4","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":2}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso","node-name":"libvirt-1-storage","read-only":true}' \ -device '{"driver":"ide-cd","bus":"ide.1","unit":0,"drive":"libvirt-1-storage","id":"ide0-1-0","bootindex":1}' \ --netdev '{"type":"tap","fd":"@iface-net0-fd@","vhost":true,"vhostfd":"@vhostfd-net0-fd@","id":"hostnet0"}' \ +-netdev '{"type":"tap","fd":"@iface-net0-fd@","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","host_mtu":1500,"netdev":"hostnet0","id":"net0","mac":"52:54:00:e5:48:58","bus":"pci.0","addr":"0x2"}' \ --netdev '{"type":"tap","fd":"@iface-net1-fd@","vhost":true,"vhostfd":"@vhostfd-net1-fd@","sndbuf":1600,"id":"hostnet1"}' \ +-netdev '{"type":"tap","fd":"@iface-net1-fd@","sndbuf":1600,"id":"hostnet1"}' \ -device '{"driver":"virtio-net-pci","host_mtu":9000,"netdev":"hostnet1","id":"net1","mac":"52:54:00:e5:48:59","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ diff --git a/tests/qemuxmlconfdata/net-virtio-network-portgroup.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-network-portgroup.x86_64-latest.args index e45b7b330e..5d9182c324 100644 --- a/tests/qemuxmlconfdata/net-virtio-network-portgroup.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-virtio-network-portgroup.x86_64-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-storage","id":"ide0-0-0","bootindex":1}' \ --netdev '{"type":"tap","fd":"@iface-net0-fd@","vhost":true,"vhostfd":"@vhostfd-net0-fd@","id":"hostnet0"}' \ +-netdev '{"type":"tap","fd":"@iface-net0-fd@","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.0","addr":"0x2"}' \ -netdev '{"type":"tap","fd":"@iface-net1-fd@","id":"hostnet1"}' \ -device '{"driver":"rtl8139","netdev":"hostnet1","id":"net1","mac":"10:11:22:33:44:55","bus":"pci.0","addr":"0x3"}' \ diff --git a/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args index ffaf2aa911..a798c184b1 100644 --- a/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-storage","id":"ide0-0-0","bootindex":1}' \ --netdev '{"type":"tap","fd":"@iface-ua-backup0-fd@","vhost":true,"vhostfd":"@vhostfd-ua-backup0-fd@","id":"hostua-backup0"}' \ +-netdev '{"type":"tap","fd":"@iface-ua-backup0-fd@","id":"hostua-backup0"}' \ -device '{"driver":"virtio-net-pci","failover":true,"netdev":"hostua-backup0","id":"ua-backup0","mac":"00:11:22:33:44:55","bus":"pci.0","addr":"0x2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"vfio-pci","host":"0000:06:12.2","id":"hostdev0","failover_pair_id":"ua-backup0","bus":"pci.0","addr":"0x3"}' \ diff --git a/tests/qemuxmlconfdata/net-virtio-vhost.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-vhost.x86_64-latest.args index da1c3a3d76..3b9dc09aec 100644 --- a/tests/qemuxmlconfdata/net-virtio-vhost.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-virtio-vhost.x86_64-latest.args @@ -28,11 +28,11 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -boot menu=on,strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x6"}' \ --netdev '{"type":"tap","fds":"XXXXXXX","vhost":true,"vhostfds":"XXXXXXX","id":"hostnet0"}' \ +-netdev '{"type":"tap","fds":"XXXXXXX","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","mq":true,"vectors":12,"netdev":"hostnet0","id":"net0","mac":"52:54:00:e5:48:58","bus":"pci.0","addr":"0x2"}' \ --netdev '{"type":"tap","fd":"@tap-vnet0-fd@","vhost":true,"vhostfd":"@vhostfd-net1-fd@","id":"hostnet1"}' \ +-netdev '{"type":"tap","fd":"@tap-vnet0-fd@","id":"hostnet1"}' \ -device '{"driver":"virtio-net-pci","ioeventfd":true,"netdev":"hostnet1","id":"net1","mac":"52:54:00:e5:48:59","bus":"pci.0","addr":"0x3"}' \ --netdev '{"type":"tap","fds":"XXXXXXX","vhost":true,"vhostfds":"XXXXXXX","id":"hostnet2"}' \ +-netdev '{"type":"tap","fds":"XXXXXXX","id":"hostnet2"}' \ -device '{"driver":"virtio-net-pci","ioeventfd":true,"mq":true,"vectors":12,"netdev":"hostnet2","id":"net2","mac":"52:54:00:e5:48:5a","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ diff --git a/tests/qemuxmlconfdata/tap-vhost-incorrect.x86_64-latest.args b/tests/qemuxmlconfdata/tap-vhost-incorrect.x86_64-latest.args index 2a9229f3f6..326528eea4 100644 --- a/tests/qemuxmlconfdata/tap-vhost-incorrect.x86_64-latest.args +++ b/tests/qemuxmlconfdata/tap-vhost-incorrect.x86_64-latest.args @@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x6"}' \ -netdev '{"type":"tap","fd":"@iface-net0-fd@","id":"hostnet0"}' \ -device '{"driver":"e1000","netdev":"hostnet0","id":"net0","mac":"52:54:00:e5:48:58","bus":"pci.0","addr":"0x2"}' \ --netdev '{"type":"tap","fd":"@iface-net1-fd@","vhost":true,"vhostfd":"@vhostfd-net1-fd@","id":"hostnet1"}' \ +-netdev '{"type":"tap","fd":"@iface-net1-fd@","id":"hostnet1"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"52:54:00:e5:48:59","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ diff --git a/tests/qemuxmlconfdata/tap-vhost.x86_64-latest.args b/tests/qemuxmlconfdata/tap-vhost.x86_64-latest.args index 3b36e2f6ce..91ce5e170f 100644 --- a/tests/qemuxmlconfdata/tap-vhost.x86_64-latest.args +++ b/tests/qemuxmlconfdata/tap-vhost.x86_64-latest.args @@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -device '{"driver":"virtio-blk-pci","event_idx":true,"bus":"pci.0","addr":"0x4","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":2}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso","node-name":"libvirt-1-storage","read-only":true}' \ -device '{"driver":"ide-cd","bus":"ide.1","unit":0,"drive":"libvirt-1-storage","id":"ide0-1-0","bootindex":1}' \ --netdev '{"type":"tap","fds":"XXXXXXX","vhost":true,"vhostfds":"XXXXXXX","id":"hostnet0"}' \ +-netdev '{"type":"tap","fds":"XXXXXXX","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","mq":true,"vectors":12,"netdev":"hostnet0","id":"net0","mac":"52:54:00:e5:48:58","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -- 2.56.0