提交 8968c494 编写于 作者: P Peter Krempa

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.
上级 389634e6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册