render / rpms / libvirt

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