提交 22e39d0e 编写于 作者: J Jiri Denemark

Wipe nodeinfo structure before filling it

The nodeinfo structure wasn't initialized in qemu driver and with the
recent change in CPU topology parsing, old value of nodeinfo->sockets
could be used and incremented giving totally bogus results.

Let's just wipe the structure completely.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 2a13ecc9
...@@ -251,18 +251,17 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, ...@@ -251,18 +251,17 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo,
int nodeGetInfo(virConnectPtr conn, int nodeGetInfo(virConnectPtr conn,
virNodeInfoPtr nodeinfo) { virNodeInfoPtr nodeinfo) {
memset(nodeinfo, 0, sizeof(*nodeinfo));
#ifdef HAVE_UNAME #ifdef HAVE_UNAME
{
struct utsname info; struct utsname info;
uname(&info); uname(&info);
if (virStrcpyStatic(nodeinfo->model, info.machine) == NULL) if (virStrcpyStatic(nodeinfo->model, info.machine) == NULL)
return -1; return -1;
}
#else /* !HAVE_UNAME */
nodeinfo->model[0] = '\0';
#endif /* !HAVE_UNAME */ #endif /* !HAVE_UNAME */
#ifdef __linux__ #ifdef __linux__
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册