]> git.ipfire.org Git - thirdparty/libvirt.git/commit
numa: avoid failure in nodememstats on non-NUMA systems
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Fri, 22 Sep 2017 14:12:23 +0000 (16:12 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 9 Nov 2017 22:11:51 +0000 (17:11 -0500)
commit010f88d5cb4eee45eaaf13c26164fd80dae1c942
treefc6a3366ae06daa75fe294cfb636eb2ed27fc19e
parent61f8361545d817e9de044f9e87b3196787ce681e
numa: avoid failure in nodememstats on non-NUMA systems

libvirt reports a fake NUMA topology in virConnectGetCapabilities
even if built without numactl support. The fake NUMA topology consists
of a single cell representing the host's cpu and memory resources.
Currently this is the case for ARM and s390[x] RPM builds.

A client iterating over NUMA cells obtained via virConnectGetCapabilities
and invoking virNodeGetMemoryStats on them will see an internal failure
"NUMA isn't available on this host" from virNumaGetMaxNode. An example
for such a client is VDSM.

Since the intention seems to be that libvirt always reports at least
a single cell it is necessary to return "fake" node memory statistics
matching the previously reported fake cell in case NUMA isn't supported
on the system.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/util/virhostmem.c