render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
3e5111
From b768a8cb9fbd84a96f576d1dd7468f664200683f Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <b768a8cb9fbd84a96f576d1dd7468f664200683f@dist-git>
3e5111
From: Jiri Denemark <jdenemar@redhat.com>
3e5111
Date: Wed, 10 May 2017 13:05:16 +0200
3e5111
Subject: [PATCH] conf: Check CPU cache for ABI stability
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
3e5111
(cherry picked from commit 1e9cf6e09ce242c94731bd21707dd3bcd41f854f)
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1449595
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/conf/cpu_conf.c | 10 ++++++++++
3e5111
 1 file changed, 10 insertions(+)
3e5111
3e5111
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
3e5111
index 1b098c476..a4be5742e 100644
3e5111
--- a/src/conf/cpu_conf.c
3e5111
+++ b/src/conf/cpu_conf.c
3e5111
@@ -915,6 +915,16 @@ virCPUDefIsEqual(virCPUDefPtr src,
3e5111
         }
3e5111
     }
3e5111
 
3e5111
+    if ((src->cache && !dst->cache) ||
3e5111
+        (!src->cache && dst->cache) ||
3e5111
+        (src->cache && dst->cache &&
3e5111
+         (src->cache->level != dst->cache->level ||
3e5111
+          src->cache->mode != dst->cache->mode))) {
3e5111
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
3e5111
+                       _("Target CPU cache does not match source"));
3e5111
+        goto cleanup;
3e5111
+    }
3e5111
+
3e5111
     identical = true;
3e5111
 
3e5111
  cleanup:
3e5111
-- 
3e5111
2.13.0
3e5111