Add helper to compare initial sizes of indivitual NUMA nodes and the map of belonging vCPUs. Other configuration is not ABI. --- src/conf/domain_conf.c | 3 +++ src/conf/numa_conf.c | 37 +++++++++++++++++++++++++++++++++++++ src/conf/numa_conf.h | 3 +++ src/libvirt_private.syms | 1 + 4 files changed, 44 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index eee01b6..15d4fe0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15964,6 +15964,9 @@ virDomainDefCheckABIStability(virDomainDefPtr src, goto error; } + if (!virDomainNumaCheckABIStability(src->numa, dst->numa)) + goto error; + if (src->vcpus != dst->vcpus) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target domain vCPU count %d does not match source %d"), diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 0a6f902..70044d5 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -814,6 +814,43 @@ virDomainNumaNew(void) } +bool +virDomainNumaCheckABIStability(virDomainNumaPtr src, + virDomainNumaPtr tgt) +{ + size_t i; + + if (virDomainNumaGetNodeCount(src) != virDomainNumaGetNodeCount(tgt)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target NUMA node count '%zu' doesn't match " + "source '%zu'"), + virDomainNumaGetNodeCount(tgt), + virDomainNumaGetNodeCount(src)); + return false; + } + + for (i = 0; i < virDomainNumaGetNodeCount(src); i++) { + if (src->mem_nodes[i].mem != tgt->mem_nodes[i].mem) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Size of target NUMA node %zu (%llu) doesn't " + "match source (%llu)"), i, + tgt->mem_nodes[i].mem, src->mem_nodes[i].mem); + return false; + } + + if (!virBitmapEqual(src->mem_nodes[i].cpumask, + tgt->mem_nodes[i].cpumask)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Processor mask of target NUMA node %zu doesn't " + "match source"), i); + return false; + } + } + + return true; +} + + size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa) { diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index 8b3c437..23265af 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -125,6 +125,9 @@ void virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa, bool virDomainNumaEquals(virDomainNumaPtr n1, virDomainNumaPtr n2); +bool virDomainNumaCheckABIStability(virDomainNumaPtr src, + virDomainNumaPtr tgt); + bool virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune); bool virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 8988b61..c02e089 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -627,6 +627,7 @@ virNodeDeviceObjUnlock; # conf/numa_conf.h +virDomainNumaCheckABIStability; virDomainNumaEquals; virDomainNumaFree; virDomainNumaGetNodeCount; -- 2.2.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list