render / rpms / libvirt

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