From e2d7189f4ff7e4a2697256cf3f695327e1d71db2 Mon Sep 17 00:00:00 2001 From: Sahid Orentino Ferdjaoui Date: Mon, 2 Jul 2018 17:42:05 +0200 Subject: [PATCH] libvirt: add qemu version check when configuring mtu for network This adds a QEMU check when configuring MTU for ethernet and bridge interface types. When creating and configuring tap devices, libvirt is setting MTU but also configures the virtio-net devices to let it discovers the MTU used. This QEMU 'host_mtu' option is supported by QEMU version 2.9 and more. Closes-Bug: 1779626 Change-Id: I55cf259c715ba129fa8479d1e8a0d11ec15aaa43 Signed-off-by: Sahid Orentino Ferdjaoui --- nova/virt/libvirt/vif.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nova/virt/libvirt/vif.py b/nova/virt/libvirt/vif.py index 7ebf290a0496..0c3fcca5b41f 100644 --- a/nova/virt/libvirt/vif.py +++ b/nova/virt/libvirt/vif.py @@ -51,8 +51,11 @@ CONF = nova.conf.CONF MIN_LIBVIRT_VHOSTUSER_MQ = (1, 2, 17) # vlan tag for macvtap passthrough mode on SRIOV VFs MIN_LIBVIRT_MACVTAP_PASSTHROUGH_VLAN = (1, 3, 5) -# setting interface mtu was intoduced in libvirt 3.3 +# setting interface mtu was intoduced in libvirt 3.3, We also need to +# check for QEMU that because libvirt is configuring in same time +# host_mtu for virtio-net, fails if not supported. MIN_LIBVIRT_INTERFACE_MTU = (3, 3, 0) +MIN_QEMU_INTERFACE_MTU = (2, 9, 0) # virtio-net.rx_queue_size support MIN_LIBVIRT_RX_QUEUE_SIZE = (2, 3, 0) @@ -276,7 +279,8 @@ class LibvirtGenericVIFDriver(object): designer.set_vif_mtu_config(conf, network.get_meta("mtu")) def _has_min_version_for_mtu(self, host): - return host.has_min_version(MIN_LIBVIRT_INTERFACE_MTU) + return host.has_min_version(MIN_LIBVIRT_INTERFACE_MTU, + MIN_QEMU_INTERFACE_MTU) def get_config_802qbg(self, instance, vif, image_meta, inst_type, virt_type, host):