mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 14:23:53 -06:00
hmp: extend "info numa" with hotplugged memory information
Report amount of hotplugged memory in addition to total amount per NUMA node. Signed-off-by: Vadim Galitsyn <vadim.galitsyn@profitbricks.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: David Hildenbrand <david@redhat.com> Cc: qemu-devel@nongnu.org Message-Id: <20170829153022.27004-2-vadim.galitsyn@profitbricks.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
4e5c3a3742
commit
31959e82fb
4 changed files with 26 additions and 9 deletions
18
numa.c
18
numa.c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue