numa: make 'info numa' take into account hotplugged memory
When do memory hotplug, if there is numa node, we should add
the memory size to the corresponding node memory size.
It affects the result of hmp command "info numa".
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/monitor.c b/monitor.c
index 1fc201a..32db7ee 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1948,7 +1948,10 @@
{
int i;
CPUState *cpu;
+ uint64_t *node_mem;
+ node_mem = g_new0(uint64_t, nb_numa_nodes);
+ query_numa_node_mem(node_mem);
monitor_printf(mon, "%d nodes\n", nb_numa_nodes);
for (i = 0; i < nb_numa_nodes; i++) {
monitor_printf(mon, "node %d cpus:", i);
@@ -1959,8 +1962,9 @@
}
monitor_printf(mon, "\n");
monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i,
- numa_info[i].node_mem >> 20);
+ node_mem[i] >> 20);
}
+ g_free(node_mem);
}
#ifdef CONFIG_PROFILER