aboutsummaryrefslogtreecommitdiff
path: root/hw/core/numa.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-07-05 09:51:50 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-07-05 09:51:50 +0100
commitc35d17cabc1e2c72ac0adfd47a0dc9ea40875069 (patch)
tree1fe20a1769036418feb4793416942a1c1fb40015 /hw/core/numa.c
parent57dfc2c4d51e770ed3f617e5d1456d1e2bacf3f0 (diff)
parent3ef4dff2b397c8932fd3b4d955cd6ba620245475 (diff)
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
virtio, pc, pci: features, fixes, cleanups virtio-pmem support. libvhost user mq support. A bunch of fixes all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 04 Jul 2019 22:00:49 BST # gpg: using RSA key 281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full] # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (22 commits) docs: avoid vhost-user-net specifics in multiqueue section libvhost-user: implement VHOST_USER_PROTOCOL_F_MQ libvhost-user: support many virtqueues libvhost-user: add vmsg_set_reply_u64() helper pc: Move compat_apic_id_mode variable to PCMachineClass virtio: Don't change "started" flag on virtio_vmstate_change() virtio: Make sure we get correct state of device on handle_aio_output() virtio: Set "start_on_kick" on virtio_set_features() virtio: Set "start_on_kick" for legacy devices virtio: add "use-started" property virtio-pci: fix missing device properties pc: Support for virtio-pmem-pci numa: Handle virtio-pmem in NUMA stats hmp: Handle virtio-pmem when printing memory device infos virtio-pci: Proxy for virtio-pmem virtio-pmem: sync linux headers virtio-pci: Allow to specify additional interfaces for the base type virtio-pmem: add virtio device pcie: minor cleanups for slot control/status pcie: work around for racy guest init ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/numa.c')
-rw-r--r--hw/core/numa.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 76c447f90a..66119d181b 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -533,6 +533,7 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[])
MemoryDeviceInfoList *info_list = qmp_memory_device_list();
MemoryDeviceInfoList *info;
PCDIMMDeviceInfo *pcdimm_info;
+ VirtioPMEMDeviceInfo *vpi;
for (info = info_list; info; info = info->next) {
MemoryDeviceInfo *value = info->value;
@@ -540,22 +541,21 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[])
if (value) {
switch (value->type) {
case MEMORY_DEVICE_INFO_KIND_DIMM:
- pcdimm_info = value->u.dimm.data;
- break;
-
case MEMORY_DEVICE_INFO_KIND_NVDIMM:
- pcdimm_info = value->u.nvdimm.data;
- break;
-
- default:
- pcdimm_info = NULL;
- break;
- }
-
- if (pcdimm_info) {
+ pcdimm_info = value->type == MEMORY_DEVICE_INFO_KIND_DIMM ?
+ value->u.dimm.data : value->u.nvdimm.data;
node_mem[pcdimm_info->node].node_mem += pcdimm_info->size;
node_mem[pcdimm_info->node].node_plugged_mem +=
pcdimm_info->size;
+ break;
+ case MEMORY_DEVICE_INFO_KIND_VIRTIO_PMEM:
+ vpi = value->u.virtio_pmem.data;
+ /* TODO: once we support numa, assign to right node */
+ node_mem[0].node_mem += vpi->size;
+ node_mem[0].node_plugged_mem += vpi->size;
+ break;
+ default:
+ g_assert_not_reached();
}
}
}