diff options
author | Haozhong Zhang | 2018-03-11 04:02:11 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2018-03-20 02:34:52 +0100 |
commit | 52c95cae4e1299e0a2a9709093581a3a96473aa5 (patch) | |
tree | 1b68945b8ae418c65034817e3d00066013fe0b46 /include/hw/mem | |
parent | hw/pci: remove obsolete PCIDevice->init() (diff) | |
download | qemu-52c95cae4e1299e0a2a9709093581a3a96473aa5.tar.gz qemu-52c95cae4e1299e0a2a9709093581a3a96473aa5.tar.xz qemu-52c95cae4e1299e0a2a9709093581a3a96473aa5.zip |
pc-dimm: make qmp_pc_dimm_device_list() sort devices by address
Make qmp_pc_dimm_device_list() return sorted by start address
list of devices so that it could be reused in places that
would need sorted list*. Reuse existing pc_dimm_built_list()
to get sorted list.
While at it hide recursive callbacks from callers, so that:
qmp_pc_dimm_device_list(qdev_get_machine(), &list);
could be replaced with simpler:
list = qmp_pc_dimm_device_list();
* follow up patch will use it in build_srat()
Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au> for ppc part
Reviewed-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/mem')
-rw-r--r-- | include/hw/mem/pc-dimm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index d83b957829..1fc479281c 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -93,7 +93,7 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start, int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp); -int qmp_pc_dimm_device_list(Object *obj, void *opaque); +MemoryDeviceInfoList *qmp_pc_dimm_device_list(void); uint64_t pc_existing_dimms_capacity(Error **errp); uint64_t get_plugged_memory_size(void); void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms, |