mirror of https://gitee.com/openkylin/libvirt.git
conf: numa: Add helper to count total memory size configured in NUMA
The total NUMA memory consists of the sum of individual NUMA node memory amounts.
This commit is contained in:
parent
389634e667
commit
8968c4946c
|
@ -894,3 +894,16 @@ virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
|
|||
{
|
||||
numa->mem_nodes[node].mem = size;
|
||||
}
|
||||
|
||||
|
||||
unsigned long long
|
||||
virDomainNumaGetMemorySize(virDomainNumaPtr numa)
|
||||
{
|
||||
size_t i;
|
||||
unsigned long long ret = 0;
|
||||
|
||||
for (i = 0; i < numa->nmem_nodes; i++)
|
||||
ret += numa->mem_nodes[i].mem;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,8 @@ virNumaMemAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa,
|
|||
unsigned long long virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
|
||||
size_t node)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/*
|
||||
* Formatters
|
||||
|
|
|
@ -630,6 +630,7 @@ virNodeDeviceObjUnlock;
|
|||
virDomainNumaCheckABIStability;
|
||||
virDomainNumaEquals;
|
||||
virDomainNumaFree;
|
||||
virDomainNumaGetMemorySize;
|
||||
virDomainNumaGetNodeCount;
|
||||
virDomainNumaGetNodeCpumask;
|
||||
virDomainNumaGetNodeMemoryAccessMode;
|
||||
|
|
Loading…
Reference in New Issue