]> 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)
committerLaine Stump <laine@laine.org>
Thu, 6 Jul 2017 18:55:23 +0000 (14:55 -0400)
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>
(cherry picked from commit f00e6f8bc9081f158b7d6a1dcfa82218b1dbfb4d)

src/qemu/qemu_hotplug.c

index e9ecd940465481ae6fbcf4ec0f4e256ce65b2b70..34accb2e3786cf4efee7de557dc7a16355f2dea7 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)