diff options
author | David Hildenbrand <david@redhat.com> | 2020-06-26 09:22:41 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-07-03 07:57:04 -0400 |
commit | 16647a82241fa6fb3cd4f8928c5cbf8b93a11671 (patch) | |
tree | fc348401ee36089a3010050de8350b40a916738f /hw/core | |
parent | 2e70874b16ac1d228b7f88a9e45209a5f4265841 (diff) |
numa: Handle virtio-mem in NUMA stats
Account the memory to the configured nid.
Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20200626072248.78761-15-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/numa.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/core/numa.c b/hw/core/numa.c index 2725886d06..e9aec69afd 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -824,6 +824,7 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[]) MemoryDeviceInfoList *info; PCDIMMDeviceInfo *pcdimm_info; VirtioPMEMDeviceInfo *vpi; + VirtioMEMDeviceInfo *vmi; for (info = info_list; info; info = info->next) { MemoryDeviceInfo *value = info->value; @@ -844,6 +845,11 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[]) node_mem[0].node_mem += vpi->size; node_mem[0].node_plugged_mem += vpi->size; break; + case MEMORY_DEVICE_INFO_KIND_VIRTIO_MEM: + vmi = value->u.virtio_mem.data; + node_mem[vmi->node].node_mem += vmi->size; + node_mem[vmi->node].node_plugged_mem += vmi->size; + break; default: g_assert_not_reached(); } |