mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
virnuma: use virNumaNodesetIsAvailable checking nodeset in virNumaSetupMemoryPolicy
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
This commit is contained in:
parent
902864184e
commit
5c8515620b
@ -98,16 +98,13 @@ virNumaSetupMemoryPolicy(virDomainNumatunePtr numatune,
|
|||||||
int maxnode = 0;
|
int maxnode = 0;
|
||||||
virBitmapPtr tmp_nodemask = NULL;
|
virBitmapPtr tmp_nodemask = NULL;
|
||||||
|
|
||||||
|
if (!virNumaNodesetIsAvailable(numatune))
|
||||||
|
return -1;
|
||||||
|
|
||||||
tmp_nodemask = virDomainNumatuneGetNodeset(numatune, nodemask, -1);
|
tmp_nodemask = virDomainNumatuneGetNodeset(numatune, nodemask, -1);
|
||||||
if (!tmp_nodemask)
|
if (!tmp_nodemask)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (numa_available() < 0) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("Host kernel is not aware of NUMA."));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
maxnode = numa_max_node();
|
maxnode = numa_max_node();
|
||||||
maxnode = maxnode < NUMA_NUM_NODES ? maxnode : NUMA_NUM_NODES;
|
maxnode = maxnode < NUMA_NUM_NODES ? maxnode : NUMA_NUM_NODES;
|
||||||
|
|
||||||
@ -347,12 +344,8 @@ int
|
|||||||
virNumaSetupMemoryPolicy(virDomainNumatunePtr numatune,
|
virNumaSetupMemoryPolicy(virDomainNumatunePtr numatune,
|
||||||
virBitmapPtr nodemask ATTRIBUTE_UNUSED)
|
virBitmapPtr nodemask ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
if (virDomainNumatuneGetNodeset(numatune, NULL, -1)) {
|
if (!virNumaNodesetIsAvailable(numatune))
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("libvirt is compiled without NUMA tuning support"));
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user