From 9aa3397f1999e569eae266cab844391e5ab65d81 Mon Sep 17 00:00:00 2001 From: Vadim Galitsyn Date: Tue, 29 Aug 2017 17:30:21 +0200 Subject: qmp: introduce query-memory-size-summary command Add a new query-memory-size-summary command which provides the following memory information in bytes: * base-memory - size of "base" memory specified with command line option -m. * plugged-memory - amount of memory that was hot-plugged. If target does not have CONFIG_MEM_HOTPLUG enabled, no value is reported. Signed-off-by: Vasilis Liaskovitis Signed-off-by: Mohammed Gamal Signed-off-by: Eduardo Otubo Signed-off-by: Vadim Galitsyn Reviewed-by: Eugene Crosser Cc: Dr. David Alan Gilbert Cc: Markus Armbruster Cc: Igor Mammedov Cc: Eric Blake Cc: qemu-devel@nongnu.org Message-Id: <20170829153022.27004-3-vadim.galitsyn@profitbricks.com> Reviewed-by: Igor Mammedov Signed-off-by: Dr. David Alan Gilbert Fixup comments as per Igor's review Added 'of' from Vadim's reply --- hw/mem/pc-dimm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/mem') diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index bdf6649083..66eace5a5c 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -159,6 +159,11 @@ uint64_t pc_existing_dimms_capacity(Error **errp) return cap.size; } +uint64_t get_plugged_memory_size(void) +{ + return pc_existing_dimms_capacity(&error_abort); +} + int qmp_pc_dimm_device_list(Object *obj, void *opaque) { MemoryDeviceInfoList ***prev = opaque; -- cgit v1.2.3