diff options
author | Peter Maydell | 2017-09-14 17:33:02 +0200 |
---|---|---|
committer | Peter Maydell | 2017-09-14 17:33:02 +0200 |
commit | 3dabde1128b671f36ac6cb36b97b273139964420 (patch) | |
tree | 82425e1bc40064e994dd0c342773e3d8607285e5 /numa.c | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/usb-20170913-pull-request' ... (diff) | |
parent | hmp: introduce 'info memory_size_summary' command (diff) | |
download | qemu-3dabde1128b671f36ac6cb36b97b273139964420.tar.gz qemu-3dabde1128b671f36ac6cb36b97b273139964420.tar.xz qemu-3dabde1128b671f36ac6cb36b97b273139964420.zip |
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20170914' into staging
HMP pull 2017-09-14
# gpg: Signature made Thu 14 Sep 2017 15:57:30 BST
# gpg: using RSA key 0x0516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7
* remotes/dgilbert/tags/pull-hmp-20170914:
hmp: introduce 'info memory_size_summary' command
qmp: introduce query-memory-size-summary command
hmp: extend "info numa" with hotplugged memory information
tests/hmp: test "none" machine with memory
dump: do not dump non-existent guest memory
hmp: fix "dump-quest-memory" segfault (arm)
hmp: fix "dump-quest-memory" segfault (ppc)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'numa.c')
-rw-r--r-- | numa.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -591,11 +591,12 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, } } -static void numa_stat_memory_devices(uint64_t node_mem[]) +static void numa_stat_memory_devices(NumaNodeMem node_mem[]) { MemoryDeviceInfoList *info_list = NULL; MemoryDeviceInfoList **prev = &info_list; MemoryDeviceInfoList *info; + PCDIMMDeviceInfo *pcdimm_info; qmp_pc_dimm_device_list(qdev_get_machine(), &prev); for (info = info_list; info; info = info->next) { @@ -603,9 +604,16 @@ static void numa_stat_memory_devices(uint64_t node_mem[]) if (value) { switch (value->type) { - case MEMORY_DEVICE_INFO_KIND_DIMM: - node_mem[value->u.dimm.data->node] += value->u.dimm.data->size; + case MEMORY_DEVICE_INFO_KIND_DIMM: { + pcdimm_info = value->u.dimm.data; + node_mem[pcdimm_info->node].node_mem += pcdimm_info->size; + if (pcdimm_info->hotpluggable && pcdimm_info->hotplugged) { + node_mem[pcdimm_info->node].node_plugged_mem += + pcdimm_info->size; + } break; + } + default: break; } @@ -614,7 +622,7 @@ static void numa_stat_memory_devices(uint64_t node_mem[]) qapi_free_MemoryDeviceInfoList(info_list); } -void query_numa_node_mem(uint64_t node_mem[]) +void query_numa_node_mem(NumaNodeMem node_mem[]) { int i; @@ -624,7 +632,7 @@ void query_numa_node_mem(uint64_t node_mem[]) numa_stat_memory_devices(node_mem); for (i = 0; i < nb_numa_nodes; i++) { - node_mem[i] += numa_info[i].node_mem; + node_mem[i].node_mem += numa_info[i].node_mem; } } |