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