提交 4a289151 编写于 作者: D Daniel P. Berrange

Cope with missing /sys/devices/system/cpu/cpu0/topology files

Not all kernel builds have any entries under the location
/sys/devices/system/cpu/cpu0/topology. We already cope with
that being missing in some cases, but not all. Update the
code which looks for thread_siblings to cope with the missing
file
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 9c29c52c
......@@ -168,6 +168,12 @@ virNodeCountThreadSiblings(const char *dir, unsigned int cpu)
pathfp = fopen(path, "r");
if (pathfp == NULL) {
/* If file doesn't exist, then pretend our only
* sibling is ourself */
if (errno == ENOENT) {
VIR_FREE(path);
return 1;
}
virReportSystemError(errno, _("cannot open %s"), path);
VIR_FREE(path);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册