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.
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;
return -1;
if (virFileExists(present_path)) {
- ncpu = linuxParseCPUmax(present_path);
+ ncpu = linuxParseCPUCount(present_path);
goto cleanup;
}