]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Set iface MTU on hotplug
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jun 2017 08:14:36 +0000 (10:14 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jun 2017 14:53:07 +0000 (16:53 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=1408701

While implementing MTU (572eda12ad and friends), I've forgotten
to actually set MTU on the host NIC in case of hotplug. We
correctly tell qemu on the monitor what the MTU should be, but we
are not actually setting it on the host NIC.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
src/qemu/qemu_hotplug.c

index 6701bd9bc88ec6f829d88f6e8b4048a71968a07e..8066acae3375fb26070d0b0e506942817074516e 100644 (file)
@@ -1134,6 +1134,10 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
         }
     }
 
+    if (net->mtu &&
+        virNetDevSetMTU(net->ifname, net->mtu) < 0)
+        goto cleanup;
+
     for (i = 0; i < tapfdSize; i++) {
         if (qemuSecuritySetTapFDLabel(driver->securityManager,
                                       vm->def, tapfd[i]) < 0)