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

nodeinfo: Introduce linuxGetCPUOnlinePath()

上级 bd87f07c
......@@ -977,6 +977,12 @@ linuxGetCPUPresentPath(const char *sysfs_prefix)
return linuxGetCPUGlobalPath(sysfs_prefix, "present");
}
static char *
linuxGetCPUOnlinePath(const char *sysfs_prefix)
{
return linuxGetCPUGlobalPath(sysfs_prefix, "online");
}
/* Determine the maximum cpu id from a Linux sysfs cpu/present file. */
static int
linuxParseCPUmax(const char *path)
......@@ -1317,7 +1323,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
if (present < 0)
return NULL;
if (virAsprintf(&online_path, "%s/cpu/online", prefix) < 0)
if (!(online_path = linuxGetCPUOnlinePath(sysfs_prefix)))
return NULL;
if (virFileExists(online_path)) {
cpumap = linuxParseCPUmap(present, online_path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册