]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: propagate bridge MTU into qemu "host_mtu" option
authorLaine Stump <laine@laine.org>
Fri, 3 Feb 2017 16:55:20 +0000 (11:55 -0500)
committerLaine Stump <laine@laine.org>
Tue, 7 Feb 2017 19:02:19 +0000 (14:02 -0500)
commit2841e6756d5807a4119e004bc5fb8e7d70806458
treeaf13489b06ac0d0123c62e6e803a62fcb029abb9
parentc0f706865e4ecac0ddaafdb4b9fc2db8d9612481
qemu: propagate bridge MTU into qemu "host_mtu" option

libvirt was able to set the host_mtu option when an MTU was explicitly
given in the interface config (with <mtu size='n'/>), set the MTU of a
libvirt network in the network config (with the same named
subelement), and would automatically set the MTU of any tap device to
the MTU of the network.

This patch ties that all together (for networks based on tap devices
and either Linux host bridges or OVS bridges) by learning the MTU of
the network (i.e. the bridge) during qemuInterfaceBridgeConnect(), and
returning that value so that it can then be passed to
qemuBuildNicDevStr(); qemuBuildNicDevStr() then sets host_mtu in the
interface's commandline options.

The result is that a higher MTU for all guests connecting to a
particular network will be plumbed top to bottom by simply changing
the MTU of the network (in libvirt's config for libvirt-managed
networks, or directly on the bridge device for simple host bridges or
OVS bridges managed outside of libvirt).

One question I have about this - it occurred to me that in the case of
migrating a guest from a host with an older libvirt to one with a
newer libvirt, the guest may have *not* had the host_mtu option on the
older machine, but *will* have it on the newer machine. I'm curious if
this could lead to incompatibilities between source and destination (I
guess it all depends on whether or not the setting of host_mtu has a
practical effect on a guest that is already running - Maxime?)

Likewise, we could run into problems when migrating from a newer
libvirt to older libvirt - The guest would have been told of the
higher MTU on the newer libvirt, then migrated to a host that didn't
understand <mtu size='blah'/>. (If this really is a problem, it would
be a problem with or without the current patch).
src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_hotplug.c
src/qemu/qemu_interface.c
src/qemu/qemu_interface.h