render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From b768a8cb9fbd84a96f576d1dd7468f664200683f Mon Sep 17 00:00:00 2001
Message-Id: <b768a8cb9fbd84a96f576d1dd7468f664200683f@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 10 May 2017 13:05:16 +0200
Subject: [PATCH] conf: Check CPU cache for ABI stability

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 1e9cf6e09ce242c94731bd21707dd3bcd41f854f)

https://bugzilla.redhat.com/show_bug.cgi?id=1449595

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/cpu_conf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 1b098c476..a4be5742e 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -915,6 +915,16 @@ virCPUDefIsEqual(virCPUDefPtr src,
         }
     }
 
+    if ((src->cache && !dst->cache) ||
+        (!src->cache && dst->cache) ||
+        (src->cache && dst->cache &&
+         (src->cache->level != dst->cache->level ||
+          src->cache->mode != dst->cache->mode))) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("Target CPU cache does not match source"));
+        goto cleanup;
+    }
+
     identical = true;
 
  cleanup:
-- 
2.13.0