[PATCH V2 4/4] cpu conf: Check ABI stability of CPU maxphysaddr config

Jim Fehlig jfehlig at suse.com
Fri Jul 29 19:34:36 UTC 2022


Signed-off-by: Jim Fehlig <jfehlig at suse.com>
---
 src/conf/cpu_conf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index e31c4ab467..8e75cdbb4f 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -1127,6 +1127,15 @@ virCPUDefIsEqual(virCPUDef *src,
         return false;
     }
 
+    if ((src->addr && !dst->addr) ||
+        (!src->addr && dst->addr) ||
+        (src->addr && dst->addr &&
+         (src->addr->mode != dst->addr->mode ||
+          src->addr->bits != dst->addr->bits))) {
+        MISMATCH("%s", _("Target CPU maxphysaddr does not match source"));
+        return false;
+    }
+
     if (src->nfeatures != dst->nfeatures) {
         MISMATCH(_("Target CPU feature count %zu does not match source %zu"),
                  dst->nfeatures, src->nfeatures);
-- 
2.36.1



More information about the libvir-list mailing list