From a9ab2abbf69d0e02a725b92b6c2729c6a870ecae Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 6 Feb 2018 17:11:40 +0100 Subject: [PATCH] conf: Check for NUMA distances in validity check 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 --- src/conf/numa_conf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index c906a53de0..9307dd93d3 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -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;