render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
3e5111
From 0ae37bb09bc282c6bca9e425990685cef6a9b1b6 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <0ae37bb09bc282c6bca9e425990685cef6a9b1b6@dist-git>
3e5111
From: Michal Privoznik <mprivozn@redhat.com>
3e5111
Date: Thu, 8 Jun 2017 16:58:35 +0200
3e5111
Subject: [PATCH] qemu: Set iface MTU on hotplug
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1408701
3e5111
3e5111
While implementing MTU (572eda12ad and friends), I've forgotten
3e5111
to actually set MTU on the host NIC in case of hotplug. We
3e5111
correctly tell qemu on the monitor what the MTU should be, but we
3e5111
are not actually setting it on the host NIC.
3e5111
3e5111
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3e5111
Reviewed-by: Laine Stump <laine@laine.org>
3e5111
(cherry picked from commit f00e6f8bc9081f158b7d6a1dcfa82218b1dbfb4d)
3e5111
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_hotplug.c | 4 ++++
3e5111
 1 file changed, 4 insertions(+)
3e5111
3e5111
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
3e5111
index 094a5644e0..ab23a575d8 100644
3e5111
--- a/src/qemu/qemu_hotplug.c
3e5111
+++ b/src/qemu/qemu_hotplug.c
3e5111
@@ -1134,6 +1134,10 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
3e5111
         }
3e5111
     }
3e5111
 
3e5111
+    if (net->mtu &&
3e5111
+        virNetDevSetMTU(net->ifname, net->mtu) < 0)
3e5111
+        goto cleanup;
3e5111
+
3e5111
     for (i = 0; i < tapfdSize; i++) {
3e5111
         if (qemuSecuritySetTapFDLabel(driver->securityManager,
3e5111
                                       vm->def, tapfd[i]) < 0)
3e5111
-- 
3e5111
2.13.1
3e5111