diff options
author | Haozhong Zhang <haozhong.zhang@intel.com> | 2018-03-11 11:02:11 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-03-20 03:34:52 +0200 |
commit | 52c95cae4e1299e0a2a9709093581a3a96473aa5 (patch) | |
tree | 1b68945b8ae418c65034817e3d00066013fe0b46 /qmp.c | |
parent | 1d0cad532ca1a5c65196e3fcd3904ef29b253b1c (diff) |
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 'qmp.c')
-rw-r--r-- | qmp.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -731,12 +731,7 @@ void qmp_object_del(const char *id, Error **errp) MemoryDeviceInfoList *qmp_query_memory_devices(Error **errp) { - MemoryDeviceInfoList *head = NULL; - MemoryDeviceInfoList **prev = &head; - - qmp_pc_dimm_device_list(qdev_get_machine(), &prev); - - return head; + return qmp_pc_dimm_device_list(); } ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error **errp) |