]> xenbits.xensource.com Git - libvirt.git/commit
Get thread and socket information in virsh nodeinfo.
authorChris Lalancette <clalance@redhat.com>
Thu, 4 Mar 2010 22:28:40 +0000 (17:28 -0500)
committerChris Lalancette <clalance@redhat.com>
Mon, 8 Mar 2010 14:26:04 +0000 (09:26 -0500)
commitaa2f6f96ddd7a57011c3d25586d588100651feb2
tree1fc7f8afcfc6ccaae4b5115a62cad5c96d14a84e
parent5140a2f626c34a2c55f776c283ceb95b6a48c788
Get thread and socket information in virsh nodeinfo.

The current code for "nodeinfo" is pretty naive
about socket and thread information.  To determine the
sockets, it just takes the number of cpus and divides
by the number of cores.  For the thread count, it always
sets it to 1.  With more recent Intel machines, however,
hyperthreading is again an option, meaning that these
heuristics no longer work and give bogus numbers.  This
patch goes through /sys to get the additional
information so we properly report it.

Note that I had to edit the tests not to report on
socket and thread counts, since these are determined
dynamically now.

v2: As pointed out by Eric Blake, gnulib provides
    count-one-bits (which is LGPLv2+).  Use it instead
    of a hand-coded popcnt.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
bootstrap.conf
src/nodeinfo.c
tests/nodeinfodata/linux-nodeinfo-1.txt
tests/nodeinfodata/linux-nodeinfo-2.txt
tests/nodeinfodata/linux-nodeinfo-3.txt
tests/nodeinfodata/linux-nodeinfo-4.txt
tests/nodeinfodata/linux-nodeinfo-5.txt
tests/nodeinfodata/linux-nodeinfo-6.txt
tests/nodeinfotest.c