提交 a2e2add1 编写于 作者: A Andrea Bolognani 提交者: Peter Krempa

nodeinfo: Rename linuxParseCPUmax() to linuxParseCPUCount()

The original name was confusing because the function returns the number
of CPUs, not the maximum CPU id. The comment above the function has
been updated to reflect this.

No behavioral changes.
上级 6fecc401
......@@ -983,9 +983,10 @@ linuxGetCPUOnlinePath(const char *sysfs_prefix)
return linuxGetCPUGlobalPath(sysfs_prefix, "online");
}
/* Determine the maximum cpu id from a Linux sysfs cpu/present file. */
/* Determine the number of CPUs (maximum CPU id + 1) from a file containing
* a list of CPU ids, like the Linux sysfs cpu/present file */
static int
linuxParseCPUmax(const char *path)
linuxParseCPUCount(const char *path)
{
char *str = NULL;
char *tmp;
......@@ -1247,7 +1248,7 @@ nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
return -1;
if (virFileExists(present_path)) {
ncpu = linuxParseCPUmax(present_path);
ncpu = linuxParseCPUCount(present_path);
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册