]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodeinfo: Don't fail on non-contiguous NUMA topologies
authorhejia hejia <jiakernel@gmail.com>
Mon, 8 Jul 2013 14:03:05 +0000 (22:03 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 12 Jul 2013 07:11:36 +0000 (09:11 +0200)
commit6d986d9918bebbb435664b8d06514733f20f3f57
tree329b279c54694f2f43517e24411841d760dff15b
parentee777e994927ed5f2d427fbc5a53cbe8b5969bda
nodeinfo: Don't fail on non-contiguous NUMA topologies

nodeGetFreeMemory and nodeGetCellsFreeMemory assumed that the NUMA nodes
are contiguous and starting from 0. Unfortunately there are machines
that don't match this assumption:

available: 1 nodes (1)
node 1 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
node 1 size: 16340 MB
node 1 free: 11065 MB

Before this patch:
error: internal error Failed to query NUMA free memory
error: internal error Failed to query NUMA free memory for node: 0

After this patch:
Total: 15772580 KiB
0: 0 KiB

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/nodeinfo.c