3e5111
From 244b42c385fc611380bfb2532905a63ce4380254 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <244b42c385fc611380bfb2532905a63ce4380254@dist-git>
3e5111
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
3e5111
Date: Tue, 16 May 2017 10:44:58 +0200
3e5111
Subject: [PATCH] conf: split out virDomainIOMMUDefCheckABIStability
3e5111
MIME-Version: 1.0
3e5111
Content-Type: text/plain; charset=UTF-8
3e5111
Content-Transfer-Encoding: 8bit
3e5111
3e5111
(cherry picked from commit 3a276c6524026b661ed7bee4539fc5387b963611)
3e5111
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1427005
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/conf/domain_conf.c | 24 +++++++++++++++++-------
3e5111
 1 file changed, 17 insertions(+), 7 deletions(-)
3e5111
3e5111
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
3e5111
index e77b542f3..7bf480f2a 100644
3e5111
--- a/src/conf/domain_conf.c
3e5111
+++ b/src/conf/domain_conf.c
3e5111
@@ -19810,6 +19810,22 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src,
3e5111
 
3e5111
 
3e5111
 static bool
3e5111
+virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src,
3e5111
+                                   virDomainIOMMUDefPtr dst)
3e5111
+{
3e5111
+    if (src->model != dst->model) {
3e5111
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
3e5111
+                       _("Target domain IOMMU device model '%s' "
3e5111
+                         "does not match source '%s'"),
3e5111
+                       virDomainIOMMUModelTypeToString(dst->model),
3e5111
+                       virDomainIOMMUModelTypeToString(src->model));
3e5111
+        return false;
3e5111
+    }
3e5111
+    return true;
3e5111
+}
3e5111
+
3e5111
+
3e5111
+static bool
3e5111
 virDomainDefVcpuCheckAbiStability(virDomainDefPtr src,
3e5111
                                   virDomainDefPtr dst)
3e5111
 {
3e5111
@@ -20275,14 +20291,8 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
3e5111
     }
3e5111
 
3e5111
     if (src->iommu &&
3e5111
-        src->iommu->model != dst->iommu->model) {
3e5111
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
3e5111
-                       _("Target domain IOMMU device model '%s' "
3e5111
-                         "does not match source '%s'"),
3e5111
-                       virDomainIOMMUModelTypeToString(dst->iommu->model),
3e5111
-                       virDomainIOMMUModelTypeToString(src->iommu->model));
3e5111
+        !virDomainIOMMUDefCheckABIStability(src->iommu, dst->iommu))
3e5111
         goto error;
3e5111
-    }
3e5111
 
3e5111
     /* Coverity is not very happy with this - all dead_error_condition */
3e5111
 #if !STATIC_ANALYSIS
3e5111
-- 
3e5111
2.13.0
3e5111