]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodeinfo: avoid probing host filesystem during test
authorEric Blake <eblake@redhat.com>
Fri, 11 May 2012 19:59:59 +0000 (13:59 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 14 May 2012 16:44:43 +0000 (10:44 -0600)
commit2b366b46dcc2b700ad02e06232d5def835dba835
tree7305bd3dc92a0fa76d298f1e3016a7abb745e8ff
parent88f12a3665438cbd390a9190edbc5fa1eddb25ae
nodeinfo: avoid probing host filesystem during test

We had previously weakened our nodeinfotest in order to ignore parsed
node values, because the parse function was mistakenly relying on
host files.  A better fix is to avoid using the numactl library, but
to instead parse the same files that numactl would read, all while
allowing the files to be relative to our choice of directory.

* src/nodeinfo.c (CPU_SYS_PATH, NODE_SYS_PATH): Replace with...
(SYSFS_SYSTEM_PATH): ...parent directory.
(linuxNodeInfoCPUPopulate): Check NUMA nodes from requested
directory (by inlining numactl code).
(nodeGetCPUmap, nodeGetMemoryStats): Adjust macro use.
* tests/nodeinfotest.c (linuxTestCompareFiles, linuxTestNodeInfo):
Update test to match.
src/nodeinfo.c
tests/nodeinfotest.c