]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: command: Don't attempt to set backend MTU for networks which don't use host...
authorPeter Krempa <pkrempa@redhat.com>
Mon, 2 Jun 2025 14:55:16 +0000 (16:55 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jun 2025 11:12:31 +0000 (13:12 +0200)
commitc61d6d060667020521b813af152560d8da8d63ab
tree988e08f672d10b40cb9aefb05571108c28200e90
parentedd5465c598b7aebf3ab1a1b51848bc50b7b7d9b
qemu: command: Don't attempt to set backend MTU for networks which don't use host backend directly

Attempting to set MTU for network types which don't actually use the
network device on the host results in a failure. The 'mtu' property is
also used e.g. for the 'host_mtu' property of e.g. 'virtio-net-pci'
which is applied even in vhost-user mode.

Use the existing switch which selects devices without a network device
backend on the host side and skip setting the MTU.

Tested by running 'passt' in vhost-user mode manually:

 passt -f --vhost-user -s /tmp/vh.sock

and the following XML:

 <interface type="vhostuser">
   <mac address="52:54:00:3d:91:97"/>
   <source type="unix" path="/tmp/vh.sock" mode="client"/>
   <model type="virtio"/>
   <mtu size="9999"/>
   <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
 </interface>

The OS in the guest reports MTU 9999.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/717
Closes: https://gitlab.com/libvirt/libvirt/-/issues/192
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c