mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
numa: Introduce virDomainNumaNodeDistanceIsUsingDefaults
The function returns true/false depending on distance configuration being present in the domain XML. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
0ededbb84e
commit
ab9baab729
@ -1137,6 +1137,27 @@ virDomainNumaSetNodeCount(virDomainNumaPtr numa, size_t nmem_nodes)
|
||||
return numa->nmem_nodes;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa,
|
||||
size_t node,
|
||||
size_t sibling)
|
||||
{
|
||||
if (node >= numa->nmem_nodes ||
|
||||
sibling >= numa->nmem_nodes)
|
||||
return false;
|
||||
|
||||
if (!numa->mem_nodes[node].distances)
|
||||
return true;
|
||||
|
||||
if (numa->mem_nodes[node].distances[sibling].value == LOCAL_DISTANCE ||
|
||||
numa->mem_nodes[node].distances[sibling].value == REMOTE_DISTANCE)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
size_t
|
||||
virDomainNumaGetNodeDistance(virDomainNumaPtr numa,
|
||||
size_t node,
|
||||
|
@ -87,6 +87,10 @@ int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
|
||||
|
||||
size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa);
|
||||
|
||||
bool virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa,
|
||||
size_t node,
|
||||
size_t sibling)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
size_t virDomainNumaGetNodeDistance(virDomainNumaPtr numa,
|
||||
size_t node,
|
||||
size_t sibling)
|
||||
|
@ -726,6 +726,7 @@ virDomainNumaGetNodeDistance;
|
||||
virDomainNumaGetNodeMemoryAccessMode;
|
||||
virDomainNumaGetNodeMemorySize;
|
||||
virDomainNumaNew;
|
||||
virDomainNumaNodeDistanceIsUsingDefaults;
|
||||
virDomainNumaSetNodeCount;
|
||||
virDomainNumaSetNodeCpumask;
|
||||
virDomainNumaSetNodeDistance;
|
||||
|
Loading…
x
Reference in New Issue
Block a user