mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
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;
|
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,
|
unsigned long long virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
|
||||||
size_t node)
|
size_t node)
|
||||||
ATTRIBUTE_NONNULL(1);
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa)
|
||||||
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Formatters
|
* Formatters
|
||||||
|
@ -630,6 +630,7 @@ virNodeDeviceObjUnlock;
|
|||||||
virDomainNumaCheckABIStability;
|
virDomainNumaCheckABIStability;
|
||||||
virDomainNumaEquals;
|
virDomainNumaEquals;
|
||||||
virDomainNumaFree;
|
virDomainNumaFree;
|
||||||
|
virDomainNumaGetMemorySize;
|
||||||
virDomainNumaGetNodeCount;
|
virDomainNumaGetNodeCount;
|
||||||
virDomainNumaGetNodeCpumask;
|
virDomainNumaGetNodeCpumask;
|
||||||
virDomainNumaGetNodeMemoryAccessMode;
|
virDomainNumaGetNodeMemoryAccessMode;
|
||||||
|
Loading…
Reference in New Issue
Block a user