render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
6d3351
From 4383e358e2d8a85bd46936c997071c3b776fffd0 Mon Sep 17 00:00:00 2001
6d3351
Message-Id: <4383e358e2d8a85bd46936c997071c3b776fffd0@dist-git>
6d3351
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
6d3351
Date: Tue, 16 May 2017 10:44:59 +0200
6d3351
Subject: [PATCH] conf: add ABI stability checks for IOMMU options
6d3351
MIME-Version: 1.0
6d3351
Content-Type: text/plain; charset=UTF-8
6d3351
Content-Transfer-Encoding: 8bit
6d3351
6d3351
https://bugzilla.redhat.com/show_bug.cgi?id=1427005
6d3351
(cherry picked from commit 935d927aa881753fff30f6236eedcf9680bca638)
6d3351
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6d3351
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6d3351
---
6d3351
 src/conf/domain_conf.c | 26 ++++++++++++++++++++++++++
6d3351
 1 file changed, 26 insertions(+)
6d3351
6d3351
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
6d3351
index 7bf480f2a..370916396 100644
6d3351
--- a/src/conf/domain_conf.c
6d3351
+++ b/src/conf/domain_conf.c
6d3351
@@ -19682,6 +19682,16 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
6d3351
         }
6d3351
     }
6d3351
 
6d3351
+    /* ioapic */
6d3351
+    if (src->ioapic != dst->ioapic) {
6d3351
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
6d3351
+                       _("State of ioapic differs: "
6d3351
+                         "source: '%s', destination: '%s'"),
6d3351
+                       virDomainIOAPICTypeToString(src->ioapic),
6d3351
+                       virDomainIOAPICTypeToString(dst->ioapic));
6d3351
+        return false;
6d3351
+    }
6d3351
+
6d3351
     return true;
6d3351
 }
6d3351
 
6d3351
@@ -19821,6 +19831,22 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src,
6d3351
                        virDomainIOMMUModelTypeToString(src->model));
6d3351
         return false;
6d3351
     }
6d3351
+    if (src->intremap != dst->intremap) {
6d3351
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
6d3351
+                       _("Target domain IOMMU device intremap value '%s' "
6d3351
+                         "does not match source '%s'"),
6d3351
+                       virTristateSwitchTypeToString(dst->intremap),
6d3351
+                       virTristateSwitchTypeToString(src->intremap));
6d3351
+        return false;
6d3351
+    }
6d3351
+    if (src->caching_mode != dst->caching_mode) {
6d3351
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
6d3351
+                       _("Target domain IOMMU device caching mode '%s' "
6d3351
+                         "does not match source '%s'"),
6d3351
+                       virTristateSwitchTypeToString(dst->caching_mode),
6d3351
+                       virTristateSwitchTypeToString(src->caching_mode));
6d3351
+        return false;
6d3351
+    }
6d3351
     return true;
6d3351
 }
6d3351
 
6d3351
-- 
6d3351
2.13.0
6d3351