mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
conf: numa: Check ABI stability of NUMA configuration
Add helper to compare initial sizes of indivitual NUMA nodes and the map of belonging vCPUs. Other configuration is not ABI.
This commit is contained in:
parent
e431c3c092
commit
b98596a717
@ -15970,6 +15970,9 @@ virDomainDefCheckABIStability(virDomainDefPtr src,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!virDomainNumaCheckABIStability(src->numa, dst->numa))
|
||||||
|
goto error;
|
||||||
|
|
||||||
if (src->vcpus != dst->vcpus) {
|
if (src->vcpus != dst->vcpus) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Target domain vCPU count %d does not match source %d"),
|
_("Target domain vCPU count %d does not match source %d"),
|
||||||
|
@ -814,6 +814,45 @@ 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 (virDomainNumaGetNodeMemorySize(src, i) !=
|
||||||
|
virDomainNumaGetNodeMemorySize(tgt, i)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Size of target NUMA node %zu (%llu) doesn't "
|
||||||
|
"match source (%llu)"), i,
|
||||||
|
virDomainNumaGetNodeMemorySize(tgt, i),
|
||||||
|
virDomainNumaGetNodeMemorySize(src, i));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!virBitmapEqual(virDomainNumaGetNodeCpumask(src, i),
|
||||||
|
virDomainNumaGetNodeCpumask(tgt, i))) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Processor mask of target NUMA node %zu doesn't "
|
||||||
|
"match source"), i);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
virDomainNumaGetNodeCount(virDomainNumaPtr numa)
|
virDomainNumaGetNodeCount(virDomainNumaPtr numa)
|
||||||
{
|
{
|
||||||
|
@ -129,6 +129,9 @@ void virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
|
|||||||
bool virDomainNumaEquals(virDomainNumaPtr n1,
|
bool virDomainNumaEquals(virDomainNumaPtr n1,
|
||||||
virDomainNumaPtr n2);
|
virDomainNumaPtr n2);
|
||||||
|
|
||||||
|
bool virDomainNumaCheckABIStability(virDomainNumaPtr src,
|
||||||
|
virDomainNumaPtr tgt);
|
||||||
|
|
||||||
bool virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune);
|
bool virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune);
|
||||||
|
|
||||||
bool virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune);
|
bool virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune);
|
||||||
|
@ -627,6 +627,7 @@ virNodeDeviceObjUnlock;
|
|||||||
|
|
||||||
|
|
||||||
# conf/numa_conf.h
|
# conf/numa_conf.h
|
||||||
|
virDomainNumaCheckABIStability;
|
||||||
virDomainNumaEquals;
|
virDomainNumaEquals;
|
||||||
virDomainNumaFree;
|
virDomainNumaFree;
|
||||||
virDomainNumaGetNodeCount;
|
virDomainNumaGetNodeCount;
|
||||||
|
Loading…
Reference in New Issue
Block a user