From: Michal Privoznik Date: Tue, 6 Feb 2018 16:11:40 +0000 (+0100) Subject: conf: Check for NUMA distances in validity check X-Git-Tag: v4.1.0-rc1~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9ab2abbf69d0e02a725b92b6c2729c6a870ecae;p=thirdparty%2Flibvirt.git 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 --- 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;