diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c index a9ba2784ac91579eabf4d16683af2da6c84ef6bc..11efe8c5029f545317664f0e1ab5d65608f6844e 100644 --- a/src/util/virhostmem.c +++ b/src/util/virhostmem.c @@ -267,6 +267,14 @@ virHostMemGetStats(int cellNum ATTRIBUTE_UNUSED, FILE *meminfo; int max_node; + /* + * Even if built without numactl, libvirt claims + * to have a one-cells NUMA topology. In such a + * case return the statistics for the entire host. + */ + if (!virNumaIsAvailable() && cellNum == 0) + cellNum = VIR_NODE_MEMORY_STATS_ALL_CELLS; + if (cellNum == VIR_NODE_MEMORY_STATS_ALL_CELLS) { if (VIR_STRDUP(meminfo_path, MEMINFO_PATH) < 0) return -1;