]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodeinfo: support kernels that lack socket information
authorEric Blake <eblake@redhat.com>
Thu, 1 Nov 2012 22:20:09 +0000 (16:20 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 16 Nov 2012 17:12:36 +0000 (10:12 -0700)
commit47976b484cfae6ff0dd9e6fcbd45d377aaeaa8f4
tree258c763012d77bd5f04112e7464f02bf00998971
parent79caaf70ae9870a46d911bb418b56fa2b3740d73
nodeinfo: support kernels that lack socket information

On RHEL 5, I was getting a segfault trying to start libvirtd,
because we were failing virNodeParseSocket but not checking
for errors, and then calling CPU_SET(-1, &sock_map) as a result.
But if you don't have a topology/physical_package_id file,
then you can just assume that the cpu belongs to socket 0.

* src/nodeinfo.c (virNodeGetCpuValue): Change bool into
default_value.
(virNodeParseSocket): Allow for default value when file is missing,
different from fatal error on reading file.
(virNodeParseNode): Update call sites to fail on error.
src/nodeinfo.c