mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
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: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
2a13ecc9be
commit
22e39d0ee4
@ -251,18 +251,17 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo,
|
||||
|
||||
int nodeGetInfo(virConnectPtr conn,
|
||||
virNodeInfoPtr nodeinfo) {
|
||||
memset(nodeinfo, 0, sizeof(*nodeinfo));
|
||||
|
||||
#ifdef HAVE_UNAME
|
||||
{
|
||||
struct utsname info;
|
||||
|
||||
uname(&info);
|
||||
|
||||
if (virStrcpyStatic(nodeinfo->model, info.machine) == NULL)
|
||||
return -1;
|
||||
|
||||
#else /* !HAVE_UNAME */
|
||||
|
||||
nodeinfo->model[0] = '\0';
|
||||
|
||||
}
|
||||
#endif /* !HAVE_UNAME */
|
||||
|
||||
#ifdef __linux__
|
||||
|
Loading…
x
Reference in New Issue
Block a user