From 5b009e400809523e71f1b72bdaa2b681e2a5b1c7 Mon Sep 17 00:00:00 2001 From: zhanghailiang Date: Tue, 4 Nov 2014 19:49:30 +0800 Subject: 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 Signed-off-by: zhanghailiang Signed-off-by: Michael Tokarev --- monitor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 1fc201a..32db7ee 100644 --- a/monitor.c +++ b/monitor.c @@ -1948,7 +1948,10 @@ static void do_info_numa(Monitor *mon, const QDict *qdict) { 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 @@ static void do_info_numa(Monitor *mon, const QDict *qdict) } 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 -- cgit v1.1