From 0e6fcb0eb5e3eb499a3cc7232fa1b7bf9f1813a2 Mon Sep 17 00:00:00 2001
From: jiangdawei15 <jiangdawei15@huawei.com>
Date: Thu, 11 Aug 2022 21:24:35 +0800
Subject: [PATCH 06/22] conf: validate serial port model in ABI checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The serial port model cannot be allowed to
change across migration as it affects ABI.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dawei Jiang jiangdawei15@huawei.com
---
 src/conf/domain_conf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1689d92c51..2d1726af8f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -23058,6 +23058,14 @@ virDomainSerialDefCheckABIStability(virDomainChrDefPtr src,
         return false;
     }
 
+    if (src->targetModel != dst->targetModel) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("Target serial model %s does not match source %s"),
+                       virDomainChrSerialTargetModelTypeToString(dst->targetModel),
+                       virDomainChrSerialTargetModelTypeToString(src->targetModel));
+        return false;
+    }
+
     if (src->target.port != dst->target.port) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("Target serial port %d does not match source %d"),
-- 
2.33.0

