aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorzhanghailiang <zhang.zhanghailiang@huawei.com>2014-11-04 19:49:30 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2014-11-11 08:50:58 +0300
commit5b009e400809523e71f1b72bdaa2b681e2a5b1c7 (patch)
treebf88c2f67db1d2d8ffd16ceaaf5fdb62b4db1a09 /monitor.c
parent7912d04be6322b16cfece6b698361ae6ed036ba9 (diff)
downloadqemu-5b009e400809523e71f1b72bdaa2b681e2a5b1c7.zip
qemu-5b009e400809523e71f1b72bdaa2b681e2a5b1c7.tar.gz
qemu-5b009e400809523e71f1b72bdaa2b681e2a5b1c7.tar.bz2
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>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 5 insertions, 1 deletions
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