mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
nodeinfo: Remove out parameter from nodeGetCPUBitmap()
Not all users of this API will need the size of the returned bitmap; those who do can simply call virBitmapSize() themselves.
This commit is contained in:
parent
37f73e4ad5
commit
ccd0ea7ef5
@ -1325,8 +1325,7 @@ nodeGetPresentCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
|
||||
}
|
||||
|
||||
virBitmapPtr
|
||||
nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
|
||||
int *max_id ATTRIBUTE_UNUSED)
|
||||
nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef __linux__
|
||||
const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
|
||||
@ -1364,8 +1363,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
|
||||
ignore_value(virBitmapSetBit(cpumap, i));
|
||||
}
|
||||
}
|
||||
if (max_id && cpumap)
|
||||
*max_id = present;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(online_path);
|
||||
VIR_FREE(cpudir);
|
||||
@ -1686,7 +1684,6 @@ nodeGetCPUMap(const char *sysfs_prefix,
|
||||
unsigned int flags)
|
||||
{
|
||||
virBitmapPtr cpus = NULL;
|
||||
int maxpresent;
|
||||
int ret = -1;
|
||||
int dummy;
|
||||
|
||||
@ -1695,7 +1692,7 @@ nodeGetCPUMap(const char *sysfs_prefix,
|
||||
if (!cpumap && !online)
|
||||
return nodeGetCPUCount(sysfs_prefix);
|
||||
|
||||
if (!(cpus = nodeGetCPUBitmap(sysfs_prefix, &maxpresent)))
|
||||
if (!(cpus = nodeGetCPUBitmap(sysfs_prefix)))
|
||||
goto cleanup;
|
||||
|
||||
if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
|
||||
@ -1703,7 +1700,8 @@ nodeGetCPUMap(const char *sysfs_prefix,
|
||||
if (online)
|
||||
*online = virBitmapCountBits(cpus);
|
||||
|
||||
ret = maxpresent;
|
||||
ret = virBitmapSize(cpus);
|
||||
|
||||
cleanup:
|
||||
if (ret < 0 && cpumap)
|
||||
VIR_FREE(*cpumap);
|
||||
|
@ -45,7 +45,7 @@ int nodeGetMemory(unsigned long long *mem,
|
||||
unsigned long long *freeMem);
|
||||
|
||||
virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
|
||||
virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix, int *max_id);
|
||||
virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix);
|
||||
int nodeGetCPUCount(const char *sysfs_prefix);
|
||||
|
||||
int nodeGetMemoryParameters(virTypedParameterPtr params,
|
||||
|
Loading…
x
Reference in New Issue
Block a user