render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
982648
From 580641d2514592b4e21f49309c9f852165788fc7 Mon Sep 17 00:00:00 2001
982648
Message-Id: <580641d2514592b4e21f49309c9f852165788fc7@dist-git>
982648
From: Michal Privoznik <mprivozn@redhat.com>
982648
Date: Tue, 4 Sep 2018 10:41:02 +0200
982648
Subject: [PATCH] virDomainNetDefCheckABIStability: Check for MTU change too
982648
MIME-Version: 1.0
982648
Content-Type: text/plain; charset=UTF-8
982648
Content-Transfer-Encoding: 8bit
982648
982648
RHEL-7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1623157
982648
RHEL-8.0: https://bugzilla.redhat.com/show_bug.cgi?id=1623158
982648
982648
Changing MTU on a running guest is not possible and trying to do
982648
so made us face many problems. That's why we forbid it in
982648
5f44d7e357f61f7. However, there is still one possible path where
982648
users can sneak in change: migration XML.
982648
982648
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
982648
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
982648
(cherry picked from commit 4ea3693104c03ac40a6595f5b9bcda58fa18afe7)
982648
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
982648
Reviewed-by: Ján Tomko <jtomko@redhat.com>
982648
---
982648
 src/conf/domain_conf.c | 7 +++++++
982648
 1 file changed, 7 insertions(+)
982648
982648
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
982648
index 49b0a59918..ed9687fde9 100644
982648
--- a/src/conf/domain_conf.c
982648
+++ b/src/conf/domain_conf.c
982648
@@ -21609,6 +21609,13 @@ virDomainNetDefCheckABIStability(virDomainNetDefPtr src,
982648
         return false;
982648
     }
982648
 
982648
+    if (src->mtu != dst->mtu) {
982648
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
982648
+                       _("Target network card MTU %d does not match source %d"),
982648
+                       dst->mtu, src->mtu);
982648
+        return false;
982648
+    }
982648
+
982648
     if (src->virtio && dst->virtio &&
982648
         !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio))
982648
         return false;
982648
-- 
982648
2.18.0
982648