]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Check for NUMA distances in validity check
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 6 Feb 2018 16:11:40 +0000 (17:11 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 7 Feb 2018 12:53:20 +0000 (13:53 +0100)
NUMA distances are part of guest ABI (guests can read it
directly!) and therefore as such shouldn't change throughout the
lifetime of domain.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/numa_conf.c

index c906a53de07f2223875137c7451723fc13a21634..9307dd93d3d47ceab9bbdc530a131b81e1548100 100644 (file)
@@ -1074,6 +1074,7 @@ virDomainNumaCheckABIStability(virDomainNumaPtr src,
                                virDomainNumaPtr tgt)
 {
     size_t i;
+    size_t j;
 
     if (virDomainNumaGetNodeCount(src) != virDomainNumaGetNodeCount(tgt)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -1102,6 +1103,17 @@ virDomainNumaCheckABIStability(virDomainNumaPtr src,
                              "match source"), i);
             return false;
         }
+
+        for (j = 0; j < virDomainNumaGetNodeCount(src); j++) {
+            if (virDomainNumaGetNodeDistance(src, i, j) !=
+                virDomainNumaGetNodeDistance(tgt, i, j)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                               _("Target NUMA distance from %zu to %zu "
+                                 "doesn't match source"), i, j);
+
+                return false;
+            }
+        }
     }
 
     return true;