[{"id":1768464,"web_url":"http://patchwork.ozlabs.org/comment/1768464/","msgid":"<CAPHE7NpcDn4oOxZV4Bhz1P15HDg2sc0JftBtojaGSOTvm3=cHQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-14T09:35:36","subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","submitter":{"id":71788,"url":"http://patchwork.ozlabs.org/api/people/71788/","name":"Vadim Galitsyn","email":"vadim.galitsyn@profitbricks.com"},"content":"Hi Guys,\n\nCould you please let me know if you have an update on this topic?\n\nThank you,\nVadim\n\nOn Tue, Aug 29, 2017 at 5:30 PM, Vadim Galitsyn <\nvadim.galitsyn@profitbricks.com> wrote:\n\n> Hi Guys,\n>\n> Sorry for the delay. This is continuation of\n>   http://lists.nongnu.org/archive/html/qemu-devel/2017-08/msg02937.html.\n>\n> I tried to update all the things according to your input\n> regarding to v6 series. I am attaching all the versions\n> history here in cover letter.\n>\n> Best regards,\n> Vadim\n>\n> v7:\n>  * hmp: 'info numa': 'struct numa_node_mem' ->\n>    'struct NumaNodeMem' (Eric);\n>\n>  * hmp: 'info numa': 'numa_node_mem.node_hotpluggable_mem' ->\n>    'NumaNodeMem.node_plugged_mem' (in order to follow the same\n>    naming schema as in the rest patches from this series);\n>\n>  * hmp: hmp_info_memory_size_summary() no longer\n>    uses &error_abort (David);\n>\n>  * qmp: documented when @plugged-memory info is omitted (Eric);\n>\n>  * qmp: added example usage of @query-memory-size-summary (Eric);\n>\n>  * qmp: 'Since: 2.10.0' -> 'Since: 2.11.0' (Eric);\n>\n>  * All commit messages updated according to Eric's recomendation.\n>\n> v6:\n>  * qmp: Renamed get_existing_hotpluggable_memory_size() ->\n>    get_plugged_memory_size();\n>\n>  * qmp: Renamed MemoryInfo.hotunpluggable_memory ->\n>    MemoryInfo.plugged_memory;\n>\n>  * qmp: Dropped superfluous parenthesis around the\n>    comparison while evaluating MemoryInfo.has_plugged_memory.\n>\n>  * hmp: Renamed 'info memory-size-summary' ->\n>    'info memory_size_summary'\n>\n> v5:\n>  * hmp: Updated description and '.help' message for\n>    'info memory-size-summary' command.\n>\n>  * hmp: Removed '-' characters from\n>    'info memory-size-summary' output.\n>\n>  * Dropped ballooned memory information.\n>\n>  * get_existing_hotpluggable_memory_size() assumed\n>    to never fail; routine now has no arguments and\n>    returns uint64_t; in case if target does not support\n>    memory hotplug, (uint64_t)-1 is returned.\n>\n>  * MemoryInfo structure:\n>    * Removed @balloon-actual-memory field.\n>    * Field @hotpluggable-memory renamed\n>      to @hotunpluggable-memory.\n>    * Updated description for fields.\n>\n>  * qmp: Updated description for\n>    query-memory-size-summary.\n>\n>  * Patch v4 splitted into series.\n>\n> v4:\n>  * Commands \"info memory\" and \"query-memory\" were renamed\n>    to \"info memory-size-summary\" and \"query-memory-size-summary\"\n>    correspondingly.\n>  * Descriptions for both commands as well as MemoryInfo structure\n>    fields were updated/renamed according to\n>    http://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg05972.html.\n>  * In MemoryInfo structure following fields are now optional:\n>    hotpluggable-memory and balloon-actual-memory.\n>  * Field \"hotpluggable-memory\" now not displayed in HMP if target\n>    has no CONFIG_MEM_HOTPLUG enabled.\n>  * Field \"balloon-actual-memory\" now not displayed in HMP if\n>    ballooning not enabled.\n>  * qapi_free_MemoryInfo() used in order to free corresponding memory\n>    instead of g_free().\n>  * #ifdef CONFIG_MEM_HOTPLUG was removed and replaced with stubs/ approach.\n>    get_exiting_hotpluggable_memory_size() function was introduced in\n>    hw/mem/pc-dimm.c (available for all targets which have\n> CONFIG_MEM_HOTPLUG\n>    enabled). For other targets, there is a stub in stubs/qmp_pc_dimm.c.\n>    In addition, stubs/qmp_pc_dimm_device_list.c was renamed to\n>    stubs/qmp_pc_dimm.c in order to reflect actual source file content.\n>  * Commit message was updated in order to reflect what was changed.\n>\n> v3:\n>  * Use PRIu64 instead of 'lu' when printing results via HMP.\n>  * Report zero hot-plugged memory instead of reporting error\n>    when target architecture has no CONFIG_MEM_HOTPLUG enabled.\n>\n> v2:\n>  * Fixed build for targets which do not have CONFIG_MEM_HOTPLUG\n>    enabled.\n>\n>\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=profitbricks-com.20150623.gappssmtp.com\n\theader.i=@profitbricks-com.20150623.gappssmtp.com\n\theader.b=\"E0cw4JIM\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtD1p2wjTz9s06\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 19:36:29 +1000 (AEST)","from localhost ([::1]:46597 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsQZO-0002G2-PN\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 05:36:26 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:45416)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vadim.galitsyn@profitbricks.com>) id 1dsQYz-0002EB-Kf\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:36:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <vadim.galitsyn@profitbricks.com>) id 1dsQYx-0006i8-Oh\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:36:01 -0400","from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:47199)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <vadim.galitsyn@profitbricks.com>)\n\tid 1dsQYx-0006gU-B6\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:35:59 -0400","by mail-wr0-x22b.google.com with SMTP id k20so5090424wre.4\n\tfor <qemu-devel@nongnu.org>; Thu, 14 Sep 2017 02:35:57 -0700 (PDT)","by 10.223.151.104 with HTTP; Thu, 14 Sep 2017 02:35:36 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=profitbricks-com.20150623.gappssmtp.com; s=20150623;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to;\n\tbh=3ZHXH2GnhRuSGDfcoOt/CrCvc+zx0HPWCos3VGGcSMI=;\n\tb=E0cw4JIMxnEi9g2JiL7+/G9ZYsFB1NMDdGYcvKZMwI9oM0f1KAjrvReIndbidgnD+7\n\tz2dS7lB1zEcteJvvI4OwI/hZ8uVXs8JsLbyp/BjnCR1KFqSYdOrCZqJCzKKoJdP/Oz1l\n\tTh/UtqyHa6O3Ojxk2VPATDi7R2mgSZPtNzvr1WtC9lRn/YmH6PmxhJUempU421Dt6ULr\n\tntD/Bf8LEauraFFS2HiWNCpCeEpAfGvus9Jpqd/CC6edtRPyNnyehAMaTj5ObVwfeiV7\n\tTUTQraYBUX1HhPaclgutQ0D+0eR1I69z3uYesEbcHW6iHe9kCCe3iLBM9RMAtiFEk33b\n\ty/7w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to;\n\tbh=3ZHXH2GnhRuSGDfcoOt/CrCvc+zx0HPWCos3VGGcSMI=;\n\tb=CpbjJJ98dOd1etTosZxKP1OGfsPX8NVRDOqeSLGOD8ldnGyQZGvCu2xD4MbBTT+7BH\n\t3l5dZvuF5upPRZ7DxkGdzVYlZddm94H5H6UotsQGja9zZXCvi7JZ6F0JJn1KyAUyFNdW\n\t5hDqrSeW/nF6E62oLXsVAxuDLU3E7fHTWNEHvawufVN41SYM76PlS9dOilNIdLd+Jg6U\n\t/toOIfBNnBIfPGE8Y5qrJSRGXpRZj0hZPBrgvIOevYeSZoHkoSzj14cq7sa7l5neY9fb\n\tPEwvIOONWr+FIt8F0vj7zsAyRkB04X/LvPmpqijncENWF0QYABbaoF+TbBv8euKtG21N\n\te69g==","X-Gm-Message-State":"AHPjjUhJcKl8vnHN9psvh5zyWsjOJHAAi3CBjNsz1DrM4TXcXHcHz4ON\n\tknEf0oCrDMtRyzdkwlaqiT+sKHm4qWn+kzo0vpSZ9Q==","X-Google-Smtp-Source":"ADKCNb5c8iATg3GrM6hb21CRhi0IAKzaErCJM7Eo5trHvUGLbFkXXvCxmZ18ISnkImmKSv3BtX9Lew5ukc1oQq+Nm/I=","X-Received":"by 10.223.164.206 with SMTP id h14mr17285094wrb.25.1505381756709;\n\tThu, 14 Sep 2017 02:35:56 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>","From":"Vadim Galitsyn <vadim.galitsyn@profitbricks.com>","Date":"Thu, 14 Sep 2017 11:35:36 +0200","Message-ID":"<CAPHE7NpcDn4oOxZV4Bhz1P15HDg2sc0JftBtojaGSOTvm3=cHQ@mail.gmail.com>","To":"Eduardo Habkost <ehabkost@redhat.com>,\n\tDavid Hildenbrand <david@redhat.com>, \n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>,\n\tMarkus Armbruster <armbru@redhat.com>, \n\tIgor Mammedov <imammedo@redhat.com>, Eric Blake <eblake@redhat.com>, \n\tqemu-devel@nongnu.org","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c0c::22b","Content-Type":"text/plain; charset=\"UTF-8\"","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768482,"web_url":"http://patchwork.ozlabs.org/comment/1768482/","msgid":"<20170914115746.382cf947@nial.brq.redhat.com>","list_archive_url":null,"date":"2017-09-14T09:57:46","subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","submitter":{"id":11305,"url":"http://patchwork.ozlabs.org/api/people/11305/","name":"Igor Mammedov","email":"imammedo@redhat.com"},"content":"On Tue, 29 Aug 2017 17:30:21 +0200\nVadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n\n> Add a new query-memory-size-summary command which provides the\n> following memory information in bytes:\n> \n>   * base-memory - size of \"base\" memory specified with command line option -m.\n> \n>   * plugged-memory - amount of memory that was hot-plugged.\n>     If target does not have CONFIG_MEM_HOTPLUG enabled, no\n>     value is reported.\n> \n> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>\n> Signed-off-by: Mohammed Gamal <mohammed.gamal@profitbricks.com>\n> Signed-off-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>\n> Signed-off-by: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>\n> Reviewed-by: Eugene Crosser <evgenii.cherkashin@profitbricks.com>\n> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>\n> Cc: Markus Armbruster <armbru@redhat.com>\n> Cc: Igor Mammedov <imammedo@redhat.com>\n> Cc: Eric Blake <eblake@redhat.com>\n> Cc: qemu-devel@nongnu.org\n> ---\n>  qapi-schema.json                                   | 32 ++++++++++++++++++++++\n>  include/hw/mem/pc-dimm.h                           |  1 +\n>  hw/mem/pc-dimm.c                                   |  5 ++++\n>  qmp.c                                              | 13 +++++++++\n>  stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} |  5 ++++\n>  stubs/Makefile.objs                                |  2 +-\n>  6 files changed, 57 insertions(+), 1 deletion(-)\n>  rename stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} (68%)\n> \n> diff --git a/qapi-schema.json b/qapi-schema.json\n> index 802ea53d00..9402ac3b3a 100644\n> --- a/qapi-schema.json\n> +++ b/qapi-schema.json\n> @@ -4407,6 +4407,38 @@\n>    'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',\n>              '*unavailable-features': [ 'str' ], 'typename': 'str' } }\n>  \n> +##\n> +# @MemoryInfo:\n> +#\n> +# Actual memory information in bytes.\n> +#\n> +# @base-memory: size of \"base\" memory specified with command line\n> +#               option -m.\n> +#\n> +# @plugged-memory: size memory that can be hot-unplugged. This field\n> +#                  is omitted if target does support memory hotplug\n> +#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).\nfield description doesn't match what's actually reported.\ns/cat be/is/\ns/does/doesn't/\n\n> +#\n> +# Since: 2.11.0\n> +##\n> +{ 'struct': 'MemoryInfo',\n> +  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }\n> +\n> +##\n> +# @query-memory-size-summary:\n> +#\n> +# Return the amount of initially allocated and hot-plugged (if\n> +# enabled) memory in bytes.\nit could count dimm's on CLI, so not only hotplugged\n\ns/hot-plugged/present hotpluggable/\n\n> +#\n> +# Example:\n> +#\n> +# -> { \"execute\": \"query-memory-size-summary\" }\n> +# <- { \"return\": { \"base-memory\": 4294967296, \"plugged-memory\": 0 } }\n> +#\n> +# Since: 2.11.0\n> +##\n> +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }\n> +\n>  ##\n>  # @query-cpu-definitions:\n>  #\n> diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h\n> index 6f8c3eb1b3..d83b957829 100644\n> --- a/include/hw/mem/pc-dimm.h\n> +++ b/include/hw/mem/pc-dimm.h\n> @@ -95,6 +95,7 @@ int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp);\n>  \n>  int qmp_pc_dimm_device_list(Object *obj, void *opaque);\n>  uint64_t pc_existing_dimms_capacity(Error **errp);\n> +uint64_t get_plugged_memory_size(void);\n>  void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,\n>                           MemoryRegion *mr, uint64_t align, Error **errp);\n>  void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms,\n> diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c\n> index bdf6649083..66eace5a5c 100644\n> --- a/hw/mem/pc-dimm.c\n> +++ b/hw/mem/pc-dimm.c\n> @@ -159,6 +159,11 @@ uint64_t pc_existing_dimms_capacity(Error **errp)\n>      return cap.size;\n>  }\n>  \n> +uint64_t get_plugged_memory_size(void)\n> +{\n> +    return pc_existing_dimms_capacity(&error_abort);\n> +}\n> +\n>  int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n>  {\n>      MemoryDeviceInfoList ***prev = opaque;\n> diff --git a/qmp.c b/qmp.c\n> index b86201e349..e8c303116a 100644\n> --- a/qmp.c\n> +++ b/qmp.c\n> @@ -709,3 +709,16 @@ ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error **errp)\n>  \n>      return head;\n>  }\n> +\n> +MemoryInfo *qmp_query_memory_size_summary(Error **errp)\n> +{\n> +    MemoryInfo *mem_info = g_malloc0(sizeof(MemoryInfo));\n> +\n> +    mem_info->base_memory = ram_size;\n> +\n> +    mem_info->plugged_memory = get_plugged_memory_size();\n> +    mem_info->has_plugged_memory =\n> +        mem_info->plugged_memory != (uint64_t)-1;\n> +\n> +    return mem_info;\n> +}\n> diff --git a/stubs/qmp_pc_dimm_device_list.c b/stubs/qmp_pc_dimm.c\n> similarity index 68%\n> rename from stubs/qmp_pc_dimm_device_list.c\n> rename to stubs/qmp_pc_dimm.c\n> index def211564d..9ddc4f619a 100644\n> --- a/stubs/qmp_pc_dimm_device_list.c\n> +++ b/stubs/qmp_pc_dimm.c\n> @@ -6,3 +6,8 @@ int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n>  {\n>     return 0;\n>  }\n> +\n> +uint64_t get_plugged_memory_size(void)\n> +{\n> +    return (uint64_t)-1;\n> +}\n> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs\n> index e69c217aff..f5f139f310 100644\n> --- a/stubs/Makefile.objs\n> +++ b/stubs/Makefile.objs\n> @@ -33,7 +33,7 @@ stub-obj-y += uuid.o\n>  stub-obj-y += vm-stop.o\n>  stub-obj-y += vmstate.o\n>  stub-obj-$(CONFIG_WIN32) += fd-register.o\n> -stub-obj-y += qmp_pc_dimm_device_list.o\n> +stub-obj-y += qmp_pc_dimm.o\n>  stub-obj-y += target-monitor-defs.o\n>  stub-obj-y += target-get-monitor-def.o\n>  stub-obj-y += pc_madt_cpu_entry.o","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=imammedo@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtDW13KX0z9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 19:58:20 +1000 (AEST)","from localhost ([::1]:46672 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsQuX-0001wA-U3\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 05:58:17 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:57633)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsQuE-0001vx-15\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:57:59 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsQu9-0002eq-Og\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:57:58 -0400","from mx1.redhat.com ([209.132.183.28]:37420)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <imammedo@redhat.com>) id 1dsQu9-0002e8-FZ\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:57:53 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 2C1A15D5EA;\n\tThu, 14 Sep 2017 09:57:52 +0000 (UTC)","from nial.brq.redhat.com (unknown [10.43.2.209])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id AD3BB5FCBD;\n\tThu, 14 Sep 2017 09:57:47 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 2C1A15D5EA","Date":"Thu, 14 Sep 2017 11:57:46 +0200","From":"Igor Mammedov <imammedo@redhat.com>","To":"Vadim Galitsyn <vadim.galitsyn@profitbricks.com>","Message-ID":"<20170914115746.382cf947@nial.brq.redhat.com>","In-Reply-To":"<20170829153022.27004-3-vadim.galitsyn@profitbricks.com>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<20170829153022.27004-3-vadim.galitsyn@profitbricks.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tThu, 14 Sep 2017 09:57:52 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Mohammed Gamal <mohammed.gamal@profitbricks.com>,\n\tEduardo Habkost <ehabkost@redhat.com>,\n\tDavid Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org,\n\tMarkus Armbruster <armbru@redhat.com>,\n\tVasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,\n\tEduardo Otubo <eduardo.otubo@profitbricks.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768485,"web_url":"http://patchwork.ozlabs.org/comment/1768485/","msgid":"<20170914120207.2dafdbfc@nial.brq.redhat.com>","list_archive_url":null,"date":"2017-09-14T10:02:07","subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","submitter":{"id":11305,"url":"http://patchwork.ozlabs.org/api/people/11305/","name":"Igor Mammedov","email":"imammedo@redhat.com"},"content":"On Thu, 14 Sep 2017 11:35:36 +0200\nVadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n\n> Hi Guys,\n> \n> Could you please let me know if you have an update on this topic?\nSeries looks good to me.\nso with comments I've made fixed up\n\nReviewed-by: Igor Mammedov <imammedo@redhat.com>\n\n> \n> Thank you,\n> Vadim\n> \n> On Tue, Aug 29, 2017 at 5:30 PM, Vadim Galitsyn <\n> vadim.galitsyn@profitbricks.com> wrote:  \n> \n> > Hi Guys,\n> >\n> > Sorry for the delay. This is continuation of\n> >   http://lists.nongnu.org/archive/html/qemu-devel/2017-08/msg02937.html.\n> >\n> > I tried to update all the things according to your input\n> > regarding to v6 series. I am attaching all the versions\n> > history here in cover letter.\n> >\n> > Best regards,\n> > Vadim\n> >\n> > v7:\n> >  * hmp: 'info numa': 'struct numa_node_mem' ->\n> >    'struct NumaNodeMem' (Eric);\n> >\n> >  * hmp: 'info numa': 'numa_node_mem.node_hotpluggable_mem' ->\n> >    'NumaNodeMem.node_plugged_mem' (in order to follow the same\n> >    naming schema as in the rest patches from this series);\n> >\n> >  * hmp: hmp_info_memory_size_summary() no longer\n> >    uses &error_abort (David);\n> >\n> >  * qmp: documented when @plugged-memory info is omitted (Eric);\n> >\n> >  * qmp: added example usage of @query-memory-size-summary (Eric);\n> >\n> >  * qmp: 'Since: 2.10.0' -> 'Since: 2.11.0' (Eric);\n> >\n> >  * All commit messages updated according to Eric's recomendation.\n> >\n> > v6:\n> >  * qmp: Renamed get_existing_hotpluggable_memory_size() ->\n> >    get_plugged_memory_size();\n> >\n> >  * qmp: Renamed MemoryInfo.hotunpluggable_memory ->\n> >    MemoryInfo.plugged_memory;\n> >\n> >  * qmp: Dropped superfluous parenthesis around the\n> >    comparison while evaluating MemoryInfo.has_plugged_memory.\n> >\n> >  * hmp: Renamed 'info memory-size-summary' ->\n> >    'info memory_size_summary'\n> >\n> > v5:\n> >  * hmp: Updated description and '.help' message for\n> >    'info memory-size-summary' command.\n> >\n> >  * hmp: Removed '-' characters from\n> >    'info memory-size-summary' output.\n> >\n> >  * Dropped ballooned memory information.\n> >\n> >  * get_existing_hotpluggable_memory_size() assumed\n> >    to never fail; routine now has no arguments and\n> >    returns uint64_t; in case if target does not support\n> >    memory hotplug, (uint64_t)-1 is returned.\n> >\n> >  * MemoryInfo structure:\n> >    * Removed @balloon-actual-memory field.\n> >    * Field @hotpluggable-memory renamed\n> >      to @hotunpluggable-memory.\n> >    * Updated description for fields.\n> >\n> >  * qmp: Updated description for\n> >    query-memory-size-summary.\n> >\n> >  * Patch v4 splitted into series.\n> >\n> > v4:\n> >  * Commands \"info memory\" and \"query-memory\" were renamed\n> >    to \"info memory-size-summary\" and \"query-memory-size-summary\"\n> >    correspondingly.\n> >  * Descriptions for both commands as well as MemoryInfo structure\n> >    fields were updated/renamed according to\n> >    http://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg05972.html.\n> >  * In MemoryInfo structure following fields are now optional:\n> >    hotpluggable-memory and balloon-actual-memory.\n> >  * Field \"hotpluggable-memory\" now not displayed in HMP if target\n> >    has no CONFIG_MEM_HOTPLUG enabled.\n> >  * Field \"balloon-actual-memory\" now not displayed in HMP if\n> >    ballooning not enabled.\n> >  * qapi_free_MemoryInfo() used in order to free corresponding memory\n> >    instead of g_free().\n> >  * #ifdef CONFIG_MEM_HOTPLUG was removed and replaced with stubs/ approach.\n> >    get_exiting_hotpluggable_memory_size() function was introduced in\n> >    hw/mem/pc-dimm.c (available for all targets which have\n> > CONFIG_MEM_HOTPLUG\n> >    enabled). For other targets, there is a stub in stubs/qmp_pc_dimm.c.\n> >    In addition, stubs/qmp_pc_dimm_device_list.c was renamed to\n> >    stubs/qmp_pc_dimm.c in order to reflect actual source file content.\n> >  * Commit message was updated in order to reflect what was changed.\n> >\n> > v3:\n> >  * Use PRIu64 instead of 'lu' when printing results via HMP.\n> >  * Report zero hot-plugged memory instead of reporting error\n> >    when target architecture has no CONFIG_MEM_HOTPLUG enabled.\n> >\n> > v2:\n> >  * Fixed build for targets which do not have CONFIG_MEM_HOTPLUG\n> >    enabled.\n> >\n> >\n> >","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=imammedo@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtDcG30gwz9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 20:02:54 +1000 (AEST)","from localhost ([::1]:46719 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsQyy-0005Eh-HQ\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 06:02:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60190)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsQyS-0005CM-72\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:02:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsQyM-00067p-6K\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:02:20 -0400","from mx1.redhat.com ([209.132.183.28]:41370)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <imammedo@redhat.com>) id 1dsQyL-00066o-T5\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:02:14 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id DA38C806A0;\n\tThu, 14 Sep 2017 10:02:12 +0000 (UTC)","from nial.brq.redhat.com (unknown [10.43.2.209])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 4707567594;\n\tThu, 14 Sep 2017 10:02:09 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DA38C806A0","Date":"Thu, 14 Sep 2017 12:02:07 +0200","From":"Igor Mammedov <imammedo@redhat.com>","To":"Vadim Galitsyn <vadim.galitsyn@profitbricks.com>","Message-ID":"<20170914120207.2dafdbfc@nial.brq.redhat.com>","In-Reply-To":"<CAPHE7NpcDn4oOxZV4Bhz1P15HDg2sc0JftBtojaGSOTvm3=cHQ@mail.gmail.com>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<CAPHE7NpcDn4oOxZV4Bhz1P15HDg2sc0JftBtojaGSOTvm3=cHQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tThu, 14 Sep 2017 10:02:13 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Eduardo Habkost <ehabkost@redhat.com>,\n\tDavid Hildenbrand <david@redhat.com>, \n\tqemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,\n\t\"Dr . David Alan Gilbert\" <dgilbert@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768491,"web_url":"http://patchwork.ozlabs.org/comment/1768491/","msgid":"<20170914100936.GF2153@work-vm>","list_archive_url":null,"date":"2017-09-14T10:09:37","subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","submitter":{"id":48102,"url":"http://patchwork.ozlabs.org/api/people/48102/","name":"Dr. David Alan Gilbert","email":"dgilbert@redhat.com"},"content":"* Igor Mammedov (imammedo@redhat.com) wrote:\n> On Thu, 14 Sep 2017 11:35:36 +0200\n> Vadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n> \n> > Hi Guys,\n> > \n> > Could you please let me know if you have an update on this topic?\n> Series looks good to me.\n> so with comments I've made fixed up\n\nOK, I can fix those comment comments up in a pull.\n\n> Reviewed-by: Igor Mammedov <imammedo@redhat.com>\n\nThanks,\n\nDave\n\n> \n> > \n> > Thank you,\n> > Vadim\n> > \n> > On Tue, Aug 29, 2017 at 5:30 PM, Vadim Galitsyn <\n> > vadim.galitsyn@profitbricks.com> wrote:  \n> > \n> > > Hi Guys,\n> > >\n> > > Sorry for the delay. This is continuation of\n> > >   http://lists.nongnu.org/archive/html/qemu-devel/2017-08/msg02937.html.\n> > >\n> > > I tried to update all the things according to your input\n> > > regarding to v6 series. I am attaching all the versions\n> > > history here in cover letter.\n> > >\n> > > Best regards,\n> > > Vadim\n> > >\n> > > v7:\n> > >  * hmp: 'info numa': 'struct numa_node_mem' ->\n> > >    'struct NumaNodeMem' (Eric);\n> > >\n> > >  * hmp: 'info numa': 'numa_node_mem.node_hotpluggable_mem' ->\n> > >    'NumaNodeMem.node_plugged_mem' (in order to follow the same\n> > >    naming schema as in the rest patches from this series);\n> > >\n> > >  * hmp: hmp_info_memory_size_summary() no longer\n> > >    uses &error_abort (David);\n> > >\n> > >  * qmp: documented when @plugged-memory info is omitted (Eric);\n> > >\n> > >  * qmp: added example usage of @query-memory-size-summary (Eric);\n> > >\n> > >  * qmp: 'Since: 2.10.0' -> 'Since: 2.11.0' (Eric);\n> > >\n> > >  * All commit messages updated according to Eric's recomendation.\n> > >\n> > > v6:\n> > >  * qmp: Renamed get_existing_hotpluggable_memory_size() ->\n> > >    get_plugged_memory_size();\n> > >\n> > >  * qmp: Renamed MemoryInfo.hotunpluggable_memory ->\n> > >    MemoryInfo.plugged_memory;\n> > >\n> > >  * qmp: Dropped superfluous parenthesis around the\n> > >    comparison while evaluating MemoryInfo.has_plugged_memory.\n> > >\n> > >  * hmp: Renamed 'info memory-size-summary' ->\n> > >    'info memory_size_summary'\n> > >\n> > > v5:\n> > >  * hmp: Updated description and '.help' message for\n> > >    'info memory-size-summary' command.\n> > >\n> > >  * hmp: Removed '-' characters from\n> > >    'info memory-size-summary' output.\n> > >\n> > >  * Dropped ballooned memory information.\n> > >\n> > >  * get_existing_hotpluggable_memory_size() assumed\n> > >    to never fail; routine now has no arguments and\n> > >    returns uint64_t; in case if target does not support\n> > >    memory hotplug, (uint64_t)-1 is returned.\n> > >\n> > >  * MemoryInfo structure:\n> > >    * Removed @balloon-actual-memory field.\n> > >    * Field @hotpluggable-memory renamed\n> > >      to @hotunpluggable-memory.\n> > >    * Updated description for fields.\n> > >\n> > >  * qmp: Updated description for\n> > >    query-memory-size-summary.\n> > >\n> > >  * Patch v4 splitted into series.\n> > >\n> > > v4:\n> > >  * Commands \"info memory\" and \"query-memory\" were renamed\n> > >    to \"info memory-size-summary\" and \"query-memory-size-summary\"\n> > >    correspondingly.\n> > >  * Descriptions for both commands as well as MemoryInfo structure\n> > >    fields were updated/renamed according to\n> > >    http://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg05972.html.\n> > >  * In MemoryInfo structure following fields are now optional:\n> > >    hotpluggable-memory and balloon-actual-memory.\n> > >  * Field \"hotpluggable-memory\" now not displayed in HMP if target\n> > >    has no CONFIG_MEM_HOTPLUG enabled.\n> > >  * Field \"balloon-actual-memory\" now not displayed in HMP if\n> > >    ballooning not enabled.\n> > >  * qapi_free_MemoryInfo() used in order to free corresponding memory\n> > >    instead of g_free().\n> > >  * #ifdef CONFIG_MEM_HOTPLUG was removed and replaced with stubs/ approach.\n> > >    get_exiting_hotpluggable_memory_size() function was introduced in\n> > >    hw/mem/pc-dimm.c (available for all targets which have\n> > > CONFIG_MEM_HOTPLUG\n> > >    enabled). For other targets, there is a stub in stubs/qmp_pc_dimm.c.\n> > >    In addition, stubs/qmp_pc_dimm_device_list.c was renamed to\n> > >    stubs/qmp_pc_dimm.c in order to reflect actual source file content.\n> > >  * Commit message was updated in order to reflect what was changed.\n> > >\n> > > v3:\n> > >  * Use PRIu64 instead of 'lu' when printing results via HMP.\n> > >  * Report zero hot-plugged memory instead of reporting error\n> > >    when target architecture has no CONFIG_MEM_HOTPLUG enabled.\n> > >\n> > > v2:\n> > >  * Fixed build for targets which do not have CONFIG_MEM_HOTPLUG\n> > >    enabled.\n> > >\n> > >\n> > >  \n> \n--\nDr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dgilbert@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtDmq63qWz9sRg\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 20:10:18 +1000 (AEST)","from localhost ([::1]:46764 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsR67-0007xy-1i\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 06:10:15 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:35935)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dsR5g-0007wk-UC\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:09:50 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dsR5c-0003kW-Sh\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:09:48 -0400","from mx1.redhat.com ([209.132.183.28]:32964)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgilbert@redhat.com>) id 1dsR5c-0003jo-Jq\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:09:44 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7023813A56;\n\tThu, 14 Sep 2017 10:09:43 +0000 (UTC)","from work-vm (ovpn-117-192.ams2.redhat.com [10.36.117.192])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 69C765C66F;\n\tThu, 14 Sep 2017 10:09:39 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 7023813A56","Date":"Thu, 14 Sep 2017 11:09:37 +0100","From":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","To":"Igor Mammedov <imammedo@redhat.com>","Message-ID":"<20170914100936.GF2153@work-vm>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<CAPHE7NpcDn4oOxZV4Bhz1P15HDg2sc0JftBtojaGSOTvm3=cHQ@mail.gmail.com>\n\t<20170914120207.2dafdbfc@nial.brq.redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170914120207.2dafdbfc@nial.brq.redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tThu, 14 Sep 2017 10:09:43 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Eduardo Habkost <ehabkost@redhat.com>,\n\tVadim Galitsyn <vadim.galitsyn@profitbricks.com>,\n\tDavid Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org,\n\tMarkus Armbruster <armbru@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768496,"web_url":"http://patchwork.ozlabs.org/comment/1768496/","msgid":"<CAPHE7NoETZU4OR_bh81aMaKXOH0yQ96yeBzPa3mws6xkQrXcTQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-14T10:25:57","subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","submitter":{"id":71788,"url":"http://patchwork.ozlabs.org/api/people/71788/","name":"Vadim Galitsyn","email":"vadim.galitsyn@profitbricks.com"},"content":"Igor, David,\n\nThank you!\n\nBest regards,\nVadim\n\nOn Thu, Sep 14, 2017 at 12:09 PM, Dr. David Alan Gilbert <\ndgilbert@redhat.com> wrote:\n\n> * Igor Mammedov (imammedo@redhat.com) wrote:\n> > On Thu, 14 Sep 2017 11:35:36 +0200\n> > Vadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n> >\n> > > Hi Guys,\n> > >\n> > > Could you please let me know if you have an update on this topic?\n> > Series looks good to me.\n> > so with comments I've made fixed up\n>\n> OK, I can fix those comment comments up in a pull.\n>\n> > Reviewed-by: Igor Mammedov <imammedo@redhat.com>\n>\n> Thanks,\n>\n> Dave\n>\n> >\n> > >\n> > > Thank you,\n> > > Vadim\n> > >\n> > > On Tue, Aug 29, 2017 at 5:30 PM, Vadim Galitsyn <\n> > > vadim.galitsyn@profitbricks.com> wrote:\n> > >\n> > > > Hi Guys,\n> > > >\n> > > > Sorry for the delay. This is continuation of\n> > > >   http://lists.nongnu.org/archive/html/qemu-devel/2017-\n> 08/msg02937.html.\n> > > >\n> > > > I tried to update all the things according to your input\n> > > > regarding to v6 series. I am attaching all the versions\n> > > > history here in cover letter.\n> > > >\n> > > > Best regards,\n> > > > Vadim\n> > > >\n> > > > v7:\n> > > >  * hmp: 'info numa': 'struct numa_node_mem' ->\n> > > >    'struct NumaNodeMem' (Eric);\n> > > >\n> > > >  * hmp: 'info numa': 'numa_node_mem.node_hotpluggable_mem' ->\n> > > >    'NumaNodeMem.node_plugged_mem' (in order to follow the same\n> > > >    naming schema as in the rest patches from this series);\n> > > >\n> > > >  * hmp: hmp_info_memory_size_summary() no longer\n> > > >    uses &error_abort (David);\n> > > >\n> > > >  * qmp: documented when @plugged-memory info is omitted (Eric);\n> > > >\n> > > >  * qmp: added example usage of @query-memory-size-summary (Eric);\n> > > >\n> > > >  * qmp: 'Since: 2.10.0' -> 'Since: 2.11.0' (Eric);\n> > > >\n> > > >  * All commit messages updated according to Eric's recomendation.\n> > > >\n> > > > v6:\n> > > >  * qmp: Renamed get_existing_hotpluggable_memory_size() ->\n> > > >    get_plugged_memory_size();\n> > > >\n> > > >  * qmp: Renamed MemoryInfo.hotunpluggable_memory ->\n> > > >    MemoryInfo.plugged_memory;\n> > > >\n> > > >  * qmp: Dropped superfluous parenthesis around the\n> > > >    comparison while evaluating MemoryInfo.has_plugged_memory.\n> > > >\n> > > >  * hmp: Renamed 'info memory-size-summary' ->\n> > > >    'info memory_size_summary'\n> > > >\n> > > > v5:\n> > > >  * hmp: Updated description and '.help' message for\n> > > >    'info memory-size-summary' command.\n> > > >\n> > > >  * hmp: Removed '-' characters from\n> > > >    'info memory-size-summary' output.\n> > > >\n> > > >  * Dropped ballooned memory information.\n> > > >\n> > > >  * get_existing_hotpluggable_memory_size() assumed\n> > > >    to never fail; routine now has no arguments and\n> > > >    returns uint64_t; in case if target does not support\n> > > >    memory hotplug, (uint64_t)-1 is returned.\n> > > >\n> > > >  * MemoryInfo structure:\n> > > >    * Removed @balloon-actual-memory field.\n> > > >    * Field @hotpluggable-memory renamed\n> > > >      to @hotunpluggable-memory.\n> > > >    * Updated description for fields.\n> > > >\n> > > >  * qmp: Updated description for\n> > > >    query-memory-size-summary.\n> > > >\n> > > >  * Patch v4 splitted into series.\n> > > >\n> > > > v4:\n> > > >  * Commands \"info memory\" and \"query-memory\" were renamed\n> > > >    to \"info memory-size-summary\" and \"query-memory-size-summary\"\n> > > >    correspondingly.\n> > > >  * Descriptions for both commands as well as MemoryInfo structure\n> > > >    fields were updated/renamed according to\n> > > >    http://lists.nongnu.org/archive/html/qemu-devel/2017-\n> 06/msg05972.html.\n> > > >  * In MemoryInfo structure following fields are now optional:\n> > > >    hotpluggable-memory and balloon-actual-memory.\n> > > >  * Field \"hotpluggable-memory\" now not displayed in HMP if target\n> > > >    has no CONFIG_MEM_HOTPLUG enabled.\n> > > >  * Field \"balloon-actual-memory\" now not displayed in HMP if\n> > > >    ballooning not enabled.\n> > > >  * qapi_free_MemoryInfo() used in order to free corresponding memory\n> > > >    instead of g_free().\n> > > >  * #ifdef CONFIG_MEM_HOTPLUG was removed and replaced with stubs/\n> approach.\n> > > >    get_exiting_hotpluggable_memory_size() function was introduced in\n> > > >    hw/mem/pc-dimm.c (available for all targets which have\n> > > > CONFIG_MEM_HOTPLUG\n> > > >    enabled). For other targets, there is a stub in\n> stubs/qmp_pc_dimm.c.\n> > > >    In addition, stubs/qmp_pc_dimm_device_list.c was renamed to\n> > > >    stubs/qmp_pc_dimm.c in order to reflect actual source file\n> content.\n> > > >  * Commit message was updated in order to reflect what was changed.\n> > > >\n> > > > v3:\n> > > >  * Use PRIu64 instead of 'lu' when printing results via HMP.\n> > > >  * Report zero hot-plugged memory instead of reporting error\n> > > >    when target architecture has no CONFIG_MEM_HOTPLUG enabled.\n> > > >\n> > > > v2:\n> > > >  * Fixed build for targets which do not have CONFIG_MEM_HOTPLUG\n> > > >    enabled.\n> > > >\n> > > >\n> > > >\n> >\n> --\n> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=profitbricks-com.20150623.gappssmtp.com\n\theader.i=@profitbricks-com.20150623.gappssmtp.com\n\theader.b=\"I+FVKi2S\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtF7p6DbFz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 20:26:46 +1000 (AEST)","from localhost ([::1]:46816 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsRM4-0008IW-VP\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 06:26:45 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:44956)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vadim.galitsyn@profitbricks.com>) id 1dsRLk-0008ID-3j\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:26:25 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <vadim.galitsyn@profitbricks.com>) id 1dsRLf-0002b9-2u\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:26:24 -0400","from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:46115)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <vadim.galitsyn@profitbricks.com>)\n\tid 1dsRLe-0002Zx-NL\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:26:19 -0400","by mail-wm0-x232.google.com with SMTP id i189so9962700wmf.1\n\tfor <qemu-devel@nongnu.org>; Thu, 14 Sep 2017 03:26:18 -0700 (PDT)","by 10.223.151.104 with HTTP; Thu, 14 Sep 2017 03:25:57 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=profitbricks-com.20150623.gappssmtp.com; s=20150623;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=Q1O4FKfNRNdhQrORFba77S3ynbUOGfTqw5KEkKd0DxI=;\n\tb=I+FVKi2SP0D1suUSbQRnIZ6jKX/59Ih90+ZVMXNS8u9j87zbzgp7QAvsBJ6N3jPnJ6\n\tKQFRfOwILPxbAB7B+b5fUcoIlOpVaqRsQAyj/T9IeiNmQGL9ejzjF3VGVPZnnjaqxwr/\n\txLk2J/uF9nMpOb9U74YM+ur2SpBSrq/9Y5VO4U9eCA8wUKRumLYsWPygTQGY1/U8qTzq\n\tHB/Mb+w5226bXeDwU0s+VbqPat6w3DXjlRgEcDygcLQXg2dVLs1RqCgSxnjjtL1XKKuI\n\tK17MY23FiFVOYi/HbVRd0rV7Cf+mgdVA9O/cQwLrRDHUry/sV8N4d//dhiQWIVC2l2jO\n\tR5kw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=Q1O4FKfNRNdhQrORFba77S3ynbUOGfTqw5KEkKd0DxI=;\n\tb=bPjArIwHVoKVrplyGdx+LjtCMWkar8R+W/Tjn5NfI3j367LzeDurKXG86UuzfOSzf7\n\tv8MaWwXhSPh+bKR4nednffo8k2pMvgIHz+6y6+Y99m7q4JkDxqqaX8U79LipHJ1JgM3U\n\tX2cSApyJr5OGboMsMkFz7dOcn5jqgmQAxAtbSFjglN0nTs7JS0OCr1vb2HmdqEzkJ2g5\n\tJr4m5JzugqC1BXXx2rC9isWOmLx1oJ7PDy3hjjv7HQ2znkTah9G5j6fO+yIOV+egkp4D\n\t9vGZkig/cVr2XMh33XCv2w7lTNtCRjwb3ImeIp2Z1Mac307CNw1RHr21EhPBvEI1le/Z\n\tlT4g==","X-Gm-Message-State":"AHPjjUjakvC1kfl3FhHZOYE4A0qZTkEF2cRwi/gCQpI8m5loiRqwj3DC\n\tEMlj76S+QaiL6sFg4SX0HvvSPJllni76JEYDLcZJ3A==","X-Google-Smtp-Source":"AOwi7QAzEIg/PmcLHCTnGnqQAF8c88e6r+YEJcnqBJLPpN+fzqEsRGVzosbRijZoH8xB5W9NcPMdjJTtkvP+7OEV2DA=","X-Received":"by 10.28.216.75 with SMTP id p72mr1591921wmg.128.1505384777627; \n\tThu, 14 Sep 2017 03:26:17 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170914100936.GF2153@work-vm>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<CAPHE7NpcDn4oOxZV4Bhz1P15HDg2sc0JftBtojaGSOTvm3=cHQ@mail.gmail.com>\n\t<20170914120207.2dafdbfc@nial.brq.redhat.com>\n\t<20170914100936.GF2153@work-vm>","From":"Vadim Galitsyn <vadim.galitsyn@profitbricks.com>","Date":"Thu, 14 Sep 2017 12:25:57 +0200","Message-ID":"<CAPHE7NoETZU4OR_bh81aMaKXOH0yQ96yeBzPa3mws6xkQrXcTQ@mail.gmail.com>","To":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c09::232","Content-Type":"text/plain; charset=\"UTF-8\"","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v7 0/3] hmp, qmp: 'info memory_size_summary',\n\t'query-memory-size-summary', 'info numa' updates","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Eduardo Habkost <ehabkost@redhat.com>,\n\tDavid Hildenbrand <david@redhat.com>, \n\tqemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,\n\tIgor Mammedov <imammedo@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768497,"web_url":"http://patchwork.ozlabs.org/comment/1768497/","msgid":"<20170914102628.GC3982@work-vm>","list_archive_url":null,"date":"2017-09-14T10:26:28","subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","submitter":{"id":48102,"url":"http://patchwork.ozlabs.org/api/people/48102/","name":"Dr. David Alan Gilbert","email":"dgilbert@redhat.com"},"content":"* Igor Mammedov (imammedo@redhat.com) wrote:\n> On Tue, 29 Aug 2017 17:30:21 +0200\n> Vadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n> \n> > Add a new query-memory-size-summary command which provides the\n> > following memory information in bytes:\n> > \n> >   * base-memory - size of \"base\" memory specified with command line option -m.\n> > \n> >   * plugged-memory - amount of memory that was hot-plugged.\n> >     If target does not have CONFIG_MEM_HOTPLUG enabled, no\n> >     value is reported.\n> > \n> > Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>\n> > Signed-off-by: Mohammed Gamal <mohammed.gamal@profitbricks.com>\n> > Signed-off-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>\n> > Signed-off-by: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>\n> > Reviewed-by: Eugene Crosser <evgenii.cherkashin@profitbricks.com>\n> > Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>\n> > Cc: Markus Armbruster <armbru@redhat.com>\n> > Cc: Igor Mammedov <imammedo@redhat.com>\n> > Cc: Eric Blake <eblake@redhat.com>\n> > Cc: qemu-devel@nongnu.org\n> > ---\n> >  qapi-schema.json                                   | 32 ++++++++++++++++++++++\n> >  include/hw/mem/pc-dimm.h                           |  1 +\n> >  hw/mem/pc-dimm.c                                   |  5 ++++\n> >  qmp.c                                              | 13 +++++++++\n> >  stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} |  5 ++++\n> >  stubs/Makefile.objs                                |  2 +-\n> >  6 files changed, 57 insertions(+), 1 deletion(-)\n> >  rename stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} (68%)\n> > \n> > diff --git a/qapi-schema.json b/qapi-schema.json\n> > index 802ea53d00..9402ac3b3a 100644\n> > --- a/qapi-schema.json\n> > +++ b/qapi-schema.json\n> > @@ -4407,6 +4407,38 @@\n> >    'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',\n> >              '*unavailable-features': [ 'str' ], 'typename': 'str' } }\n> >  \n> > +##\n> > +# @MemoryInfo:\n> > +#\n> > +# Actual memory information in bytes.\n> > +#\n> > +# @base-memory: size of \"base\" memory specified with command line\n> > +#               option -m.\n> > +#\n> > +# @plugged-memory: size memory that can be hot-unplugged. This field\n> > +#                  is omitted if target does support memory hotplug\n> > +#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).\n> field description doesn't match what's actually reported.\n> s/cat be/is/\n\nAre you sure about that? That would read:\n      size memory that is hot-unplugged\n\nwhich doesn't sound right, since it's not be hot-unplugged\nyet.\n\nDave\n\n> s/does/doesn't/\n> \n> > +#\n> > +# Since: 2.11.0\n> > +##\n> > +{ 'struct': 'MemoryInfo',\n> > +  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }\n> > +\n> > +##\n> > +# @query-memory-size-summary:\n> > +#\n> > +# Return the amount of initially allocated and hot-plugged (if\n> > +# enabled) memory in bytes.\n> it could count dimm's on CLI, so not only hotplugged\n> \n> s/hot-plugged/present hotpluggable/\n> \n> > +#\n> > +# Example:\n> > +#\n> > +# -> { \"execute\": \"query-memory-size-summary\" }\n> > +# <- { \"return\": { \"base-memory\": 4294967296, \"plugged-memory\": 0 } }\n> > +#\n> > +# Since: 2.11.0\n> > +##\n> > +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }\n> > +\n> >  ##\n> >  # @query-cpu-definitions:\n> >  #\n> > diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h\n> > index 6f8c3eb1b3..d83b957829 100644\n> > --- a/include/hw/mem/pc-dimm.h\n> > +++ b/include/hw/mem/pc-dimm.h\n> > @@ -95,6 +95,7 @@ int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp);\n> >  \n> >  int qmp_pc_dimm_device_list(Object *obj, void *opaque);\n> >  uint64_t pc_existing_dimms_capacity(Error **errp);\n> > +uint64_t get_plugged_memory_size(void);\n> >  void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,\n> >                           MemoryRegion *mr, uint64_t align, Error **errp);\n> >  void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms,\n> > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c\n> > index bdf6649083..66eace5a5c 100644\n> > --- a/hw/mem/pc-dimm.c\n> > +++ b/hw/mem/pc-dimm.c\n> > @@ -159,6 +159,11 @@ uint64_t pc_existing_dimms_capacity(Error **errp)\n> >      return cap.size;\n> >  }\n> >  \n> > +uint64_t get_plugged_memory_size(void)\n> > +{\n> > +    return pc_existing_dimms_capacity(&error_abort);\n> > +}\n> > +\n> >  int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n> >  {\n> >      MemoryDeviceInfoList ***prev = opaque;\n> > diff --git a/qmp.c b/qmp.c\n> > index b86201e349..e8c303116a 100644\n> > --- a/qmp.c\n> > +++ b/qmp.c\n> > @@ -709,3 +709,16 @@ ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error **errp)\n> >  \n> >      return head;\n> >  }\n> > +\n> > +MemoryInfo *qmp_query_memory_size_summary(Error **errp)\n> > +{\n> > +    MemoryInfo *mem_info = g_malloc0(sizeof(MemoryInfo));\n> > +\n> > +    mem_info->base_memory = ram_size;\n> > +\n> > +    mem_info->plugged_memory = get_plugged_memory_size();\n> > +    mem_info->has_plugged_memory =\n> > +        mem_info->plugged_memory != (uint64_t)-1;\n> > +\n> > +    return mem_info;\n> > +}\n> > diff --git a/stubs/qmp_pc_dimm_device_list.c b/stubs/qmp_pc_dimm.c\n> > similarity index 68%\n> > rename from stubs/qmp_pc_dimm_device_list.c\n> > rename to stubs/qmp_pc_dimm.c\n> > index def211564d..9ddc4f619a 100644\n> > --- a/stubs/qmp_pc_dimm_device_list.c\n> > +++ b/stubs/qmp_pc_dimm.c\n> > @@ -6,3 +6,8 @@ int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n> >  {\n> >     return 0;\n> >  }\n> > +\n> > +uint64_t get_plugged_memory_size(void)\n> > +{\n> > +    return (uint64_t)-1;\n> > +}\n> > diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs\n> > index e69c217aff..f5f139f310 100644\n> > --- a/stubs/Makefile.objs\n> > +++ b/stubs/Makefile.objs\n> > @@ -33,7 +33,7 @@ stub-obj-y += uuid.o\n> >  stub-obj-y += vm-stop.o\n> >  stub-obj-y += vmstate.o\n> >  stub-obj-$(CONFIG_WIN32) += fd-register.o\n> > -stub-obj-y += qmp_pc_dimm_device_list.o\n> > +stub-obj-y += qmp_pc_dimm.o\n> >  stub-obj-y += target-monitor-defs.o\n> >  stub-obj-y += target-get-monitor-def.o\n> >  stub-obj-y += pc_madt_cpu_entry.o\n> \n--\nDr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dgilbert@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtF8J3HRDz9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 20:27:12 +1000 (AEST)","from localhost ([::1]:46817 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsRMU-0000Dj-Gn\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 06:27:10 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:45059)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dsRM0-00006B-80\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:26:41 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dsRLx-0002xV-1d\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:26:40 -0400","from mx1.redhat.com ([209.132.183.28]:38806)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgilbert@redhat.com>) id 1dsRLw-0002wE-PO\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:26:36 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 9D573C04B303;\n\tThu, 14 Sep 2017 10:26:35 +0000 (UTC)","from work-vm (ovpn-117-192.ams2.redhat.com [10.36.117.192])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id BD305173E5;\n\tThu, 14 Sep 2017 10:26:31 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 9D573C04B303","Date":"Thu, 14 Sep 2017 11:26:28 +0100","From":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","To":"Igor Mammedov <imammedo@redhat.com>","Message-ID":"<20170914102628.GC3982@work-vm>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<20170829153022.27004-3-vadim.galitsyn@profitbricks.com>\n\t<20170914115746.382cf947@nial.brq.redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170914115746.382cf947@nial.brq.redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tThu, 14 Sep 2017 10:26:35 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Mohammed Gamal <mohammed.gamal@profitbricks.com>,\n\tEduardo Habkost <ehabkost@redhat.com>,\n\tVadim Galitsyn <vadim.galitsyn@profitbricks.com>,\n\tDavid Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org,\n\tMarkus Armbruster <armbru@redhat.com>,\n\tVasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,\n\tEduardo Otubo <eduardo.otubo@profitbricks.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768500,"web_url":"http://patchwork.ozlabs.org/comment/1768500/","msgid":"<CAPHE7NqL1VHz2k_Gep5-eE2HhDy3iQLG9AWa2dRaM9nD9s9uCA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-14T10:31:20","subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","submitter":{"id":71788,"url":"http://patchwork.ozlabs.org/api/people/71788/","name":"Vadim Galitsyn","email":"vadim.galitsyn@profitbricks.com"},"content":"I think I made a typo here. It should be:\n\n+# @plugged-memory: size *of* memory that can be hot-unplugged. This field\n+#                  is omitted if target does *not* support memory hotplug\n+#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).\n\n\n\n\nOn Thu, Sep 14, 2017 at 12:26 PM, Dr. David Alan Gilbert <\ndgilbert@redhat.com> wrote:\n\n> * Igor Mammedov (imammedo@redhat.com) wrote:\n> > On Tue, 29 Aug 2017 17:30:21 +0200\n> > Vadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n> >\n> > > Add a new query-memory-size-summary command which provides the\n> > > following memory information in bytes:\n> > >\n> > >   * base-memory - size of \"base\" memory specified with command line\n> option -m.\n> > >\n> > >   * plugged-memory - amount of memory that was hot-plugged.\n> > >     If target does not have CONFIG_MEM_HOTPLUG enabled, no\n> > >     value is reported.\n> > >\n> > > Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@\n> profitbricks.com>\n> > > Signed-off-by: Mohammed Gamal <mohammed.gamal@profitbricks.com>\n> > > Signed-off-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>\n> > > Signed-off-by: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>\n> > > Reviewed-by: Eugene Crosser <evgenii.cherkashin@profitbricks.com>\n> > > Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>\n> > > Cc: Markus Armbruster <armbru@redhat.com>\n> > > Cc: Igor Mammedov <imammedo@redhat.com>\n> > > Cc: Eric Blake <eblake@redhat.com>\n> > > Cc: qemu-devel@nongnu.org\n> > > ---\n> > >  qapi-schema.json                                   | 32\n> ++++++++++++++++++++++\n> > >  include/hw/mem/pc-dimm.h                           |  1 +\n> > >  hw/mem/pc-dimm.c                                   |  5 ++++\n> > >  qmp.c                                              | 13 +++++++++\n> > >  stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} |  5 ++++\n> > >  stubs/Makefile.objs                                |  2 +-\n> > >  6 files changed, 57 insertions(+), 1 deletion(-)\n> > >  rename stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} (68%)\n> > >\n> > > diff --git a/qapi-schema.json b/qapi-schema.json\n> > > index 802ea53d00..9402ac3b3a 100644\n> > > --- a/qapi-schema.json\n> > > +++ b/qapi-schema.json\n> > > @@ -4407,6 +4407,38 @@\n> > >    'data': { 'name': 'str', '*migration-safe': 'bool', 'static':\n> 'bool',\n> > >              '*unavailable-features': [ 'str' ], 'typename': 'str' } }\n> > >\n> > > +##\n> > > +# @MemoryInfo:\n> > > +#\n> > > +# Actual memory information in bytes.\n> > > +#\n> > > +# @base-memory: size of \"base\" memory specified with command line\n> > > +#               option -m.\n> > > +#\n> > > +# @plugged-memory: size memory that can be hot-unplugged. This field\n> > > +#                  is omitted if target does support memory hotplug\n> > > +#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build\n> time).\n> > field description doesn't match what's actually reported.\n> > s/cat be/is/\n>\n> Are you sure about that? That would read:\n>       size memory that is hot-unplugged\n>\n> which doesn't sound right, since it's not be hot-unplugged\n> yet.\n>\n> Dave\n>\n> > s/does/doesn't/\n> >\n> > > +#\n> > > +# Since: 2.11.0\n> > > +##\n> > > +{ 'struct': 'MemoryInfo',\n> > > +  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }\n> > > +\n> > > +##\n> > > +# @query-memory-size-summary:\n> > > +#\n> > > +# Return the amount of initially allocated and hot-plugged (if\n> > > +# enabled) memory in bytes.\n> > it could count dimm's on CLI, so not only hotplugged\n> >\n> > s/hot-plugged/present hotpluggable/\n> >\n> > > +#\n> > > +# Example:\n> > > +#\n> > > +# -> { \"execute\": \"query-memory-size-summary\" }\n> > > +# <- { \"return\": { \"base-memory\": 4294967296, \"plugged-memory\": 0 } }\n> > > +#\n> > > +# Since: 2.11.0\n> > > +##\n> > > +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }\n> > > +\n> > >  ##\n> > >  # @query-cpu-definitions:\n> > >  #\n> > > diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h\n> > > index 6f8c3eb1b3..d83b957829 100644\n> > > --- a/include/hw/mem/pc-dimm.h\n> > > +++ b/include/hw/mem/pc-dimm.h\n> > > @@ -95,6 +95,7 @@ int pc_dimm_get_free_slot(const int *hint, int\n> max_slots, Error **errp);\n> > >\n> > >  int qmp_pc_dimm_device_list(Object *obj, void *opaque);\n> > >  uint64_t pc_existing_dimms_capacity(Error **errp);\n> > > +uint64_t get_plugged_memory_size(void);\n> > >  void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,\n> > >                           MemoryRegion *mr, uint64_t align, Error\n> **errp);\n> > >  void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState\n> *hpms,\n> > > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c\n> > > index bdf6649083..66eace5a5c 100644\n> > > --- a/hw/mem/pc-dimm.c\n> > > +++ b/hw/mem/pc-dimm.c\n> > > @@ -159,6 +159,11 @@ uint64_t pc_existing_dimms_capacity(Error **errp)\n> > >      return cap.size;\n> > >  }\n> > >\n> > > +uint64_t get_plugged_memory_size(void)\n> > > +{\n> > > +    return pc_existing_dimms_capacity(&error_abort);\n> > > +}\n> > > +\n> > >  int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n> > >  {\n> > >      MemoryDeviceInfoList ***prev = opaque;\n> > > diff --git a/qmp.c b/qmp.c\n> > > index b86201e349..e8c303116a 100644\n> > > --- a/qmp.c\n> > > +++ b/qmp.c\n> > > @@ -709,3 +709,16 @@ ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error\n> **errp)\n> > >\n> > >      return head;\n> > >  }\n> > > +\n> > > +MemoryInfo *qmp_query_memory_size_summary(Error **errp)\n> > > +{\n> > > +    MemoryInfo *mem_info = g_malloc0(sizeof(MemoryInfo));\n> > > +\n> > > +    mem_info->base_memory = ram_size;\n> > > +\n> > > +    mem_info->plugged_memory = get_plugged_memory_size();\n> > > +    mem_info->has_plugged_memory =\n> > > +        mem_info->plugged_memory != (uint64_t)-1;\n> > > +\n> > > +    return mem_info;\n> > > +}\n> > > diff --git a/stubs/qmp_pc_dimm_device_list.c b/stubs/qmp_pc_dimm.c\n> > > similarity index 68%\n> > > rename from stubs/qmp_pc_dimm_device_list.c\n> > > rename to stubs/qmp_pc_dimm.c\n> > > index def211564d..9ddc4f619a 100644\n> > > --- a/stubs/qmp_pc_dimm_device_list.c\n> > > +++ b/stubs/qmp_pc_dimm.c\n> > > @@ -6,3 +6,8 @@ int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n> > >  {\n> > >     return 0;\n> > >  }\n> > > +\n> > > +uint64_t get_plugged_memory_size(void)\n> > > +{\n> > > +    return (uint64_t)-1;\n> > > +}\n> > > diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs\n> > > index e69c217aff..f5f139f310 100644\n> > > --- a/stubs/Makefile.objs\n> > > +++ b/stubs/Makefile.objs\n> > > @@ -33,7 +33,7 @@ stub-obj-y += uuid.o\n> > >  stub-obj-y += vm-stop.o\n> > >  stub-obj-y += vmstate.o\n> > >  stub-obj-$(CONFIG_WIN32) += fd-register.o\n> > > -stub-obj-y += qmp_pc_dimm_device_list.o\n> > > +stub-obj-y += qmp_pc_dimm.o\n> > >  stub-obj-y += target-monitor-defs.o\n> > >  stub-obj-y += target-get-monitor-def.o\n> > >  stub-obj-y += pc_madt_cpu_entry.o\n> >\n> --\n> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=profitbricks-com.20150623.gappssmtp.com\n\theader.i=@profitbricks-com.20150623.gappssmtp.com\n\theader.b=\"xZRPw3CG\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtFG64NXZz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 20:32:13 +1000 (AEST)","from localhost ([::1]:46839 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsRRK-0003Tp-Oz\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 06:32:10 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47949)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vadim.galitsyn@profitbricks.com>) id 1dsRQv-0003TQ-4f\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:31:51 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <vadim.galitsyn@profitbricks.com>) id 1dsRQt-00015p-05\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:31:45 -0400","from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:43276)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <vadim.galitsyn@profitbricks.com>)\n\tid 1dsRQs-00014u-MI\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:31:42 -0400","by mail-wm0-x231.google.com with SMTP id a137so4889791wma.0\n\tfor <qemu-devel@nongnu.org>; Thu, 14 Sep 2017 03:31:42 -0700 (PDT)","by 10.223.151.104 with HTTP; Thu, 14 Sep 2017 03:31:20 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=profitbricks-com.20150623.gappssmtp.com; s=20150623;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=ef/OhwRsKs/l3si2MZbAZckBHAnAgASOBX25vy+XhW8=;\n\tb=xZRPw3CG6xyhM1oUwhyuiSk8/t4LnIfHQNagSg62xYIczea0GulTOSgx3kYVFUcd0B\n\trNQuQvsx7+JqY6L4+cEW+ePK0bovTsB4arcp7/QGj4gvczSj158ixjRbDhRVfVz5Fm9Y\n\tYR0sAjALPBzuCsp4lhkr4OCFllPWS8jieXE4dR6yts73pY1qai9gFNjedl4bIhqM0HyI\n\tlMQEtYT0GD50EWFLmy0r2EB9NoyT/kYLKqh94u/94H7HKMnmW8ysXEcYsN3ujW8axMdR\n\tVvY8TJ4dixMxGxEacytfvf6ySaVAtG8HnF44EK6pTk6LOXEHkT2xYg2Ki+n61wihsH/P\n\tMdWw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=ef/OhwRsKs/l3si2MZbAZckBHAnAgASOBX25vy+XhW8=;\n\tb=no6xB0T9VZg8m2KEwYUbiN+QTu9vVu0d5Ux2qvKHDC5FCjQBFOrgUv3zdhs3wVAevL\n\t0+9SMwO0QFWjr+BMjoG2SgAh9yv4fjS0GHlY5HcG/BkIYvcGcnCtS8laVVOh/XfHrbdf\n\tHPtIEh4Iko2gKu9xJVuRlv1vbfBjWZTNXjn2UJdlIPj77M47pzSmCMObcOiTha2rA4uj\n\t2qrU490Jwi8IXaIPF0nA9yLsxUGS/vmBlH6PYEMS/PBLDkLZUib5AjRiX/81q4glJQ0k\n\taSERLy+/rq2/AG3gcYHOiNuq+RvKWViDiboDrI7nlCFWMnRRWTKq3JLEBGnlXCVw+Sqk\n\tJ1vA==","X-Gm-Message-State":"AHPjjUhVhLR4lVHm3oyuZehbNl61JjJEOh+uVjr66EOVsNhwo3d7C3VI\n\t+d0j1ESTyltKuDNTeiRkNY33AASOGw5t7KcU7iEdJg==","X-Google-Smtp-Source":"AOwi7QAFIQg2ljcCCBo2g/sOuNBcoeXsGrB5F7BhVqvZuP2WJ3p7A3aqMn05HTKoPRHSpX0mZPi5IDTjq3K432vrYWc=","X-Received":"by 10.28.9.135 with SMTP id 129mr1541707wmj.93.1505385101389;\n\tThu, 14 Sep 2017 03:31:41 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170914102628.GC3982@work-vm>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<20170829153022.27004-3-vadim.galitsyn@profitbricks.com>\n\t<20170914115746.382cf947@nial.brq.redhat.com>\n\t<20170914102628.GC3982@work-vm>","From":"Vadim Galitsyn <vadim.galitsyn@profitbricks.com>","Date":"Thu, 14 Sep 2017 12:31:20 +0200","Message-ID":"<CAPHE7NqL1VHz2k_Gep5-eE2HhDy3iQLG9AWa2dRaM9nD9s9uCA@mail.gmail.com>","To":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c09::231","Content-Type":"text/plain; charset=\"UTF-8\"","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Mohammed Gamal <mohammed.gamal@profitbricks.com>,\n\tEduardo Habkost <ehabkost@redhat.com>,\n\tDavid Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org,\n\tMarkus Armbruster <armbru@redhat.com>,\n\tVasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,\n\tEduardo Otubo <eduardo.otubo@profitbricks.com>,\n\tIgor Mammedov <imammedo@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768514,"web_url":"http://patchwork.ozlabs.org/comment/1768514/","msgid":"<20170914110607.GD3982@work-vm>","list_archive_url":null,"date":"2017-09-14T11:06:08","subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","submitter":{"id":48102,"url":"http://patchwork.ozlabs.org/api/people/48102/","name":"Dr. David Alan Gilbert","email":"dgilbert@redhat.com"},"content":"* Vadim Galitsyn (vadim.galitsyn@profitbricks.com) wrote:\n> I think I made a typo here. It should be:\n> \n> +# @plugged-memory: size *of* memory that can be hot-unplugged. This field\n> +#                  is omitted if target does *not* support memory hotplug\n> +#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).\n\n'of' added, took the 'don't' from Igor's review.\n\nDave\n\n> \n> \n> \n> On Thu, Sep 14, 2017 at 12:26 PM, Dr. David Alan Gilbert <\n> dgilbert@redhat.com> wrote:\n> \n> > * Igor Mammedov (imammedo@redhat.com) wrote:\n> > > On Tue, 29 Aug 2017 17:30:21 +0200\n> > > Vadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n> > >\n> > > > Add a new query-memory-size-summary command which provides the\n> > > > following memory information in bytes:\n> > > >\n> > > >   * base-memory - size of \"base\" memory specified with command line\n> > option -m.\n> > > >\n> > > >   * plugged-memory - amount of memory that was hot-plugged.\n> > > >     If target does not have CONFIG_MEM_HOTPLUG enabled, no\n> > > >     value is reported.\n> > > >\n> > > > Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@\n> > profitbricks.com>\n> > > > Signed-off-by: Mohammed Gamal <mohammed.gamal@profitbricks.com>\n> > > > Signed-off-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>\n> > > > Signed-off-by: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>\n> > > > Reviewed-by: Eugene Crosser <evgenii.cherkashin@profitbricks.com>\n> > > > Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>\n> > > > Cc: Markus Armbruster <armbru@redhat.com>\n> > > > Cc: Igor Mammedov <imammedo@redhat.com>\n> > > > Cc: Eric Blake <eblake@redhat.com>\n> > > > Cc: qemu-devel@nongnu.org\n> > > > ---\n> > > >  qapi-schema.json                                   | 32\n> > ++++++++++++++++++++++\n> > > >  include/hw/mem/pc-dimm.h                           |  1 +\n> > > >  hw/mem/pc-dimm.c                                   |  5 ++++\n> > > >  qmp.c                                              | 13 +++++++++\n> > > >  stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} |  5 ++++\n> > > >  stubs/Makefile.objs                                |  2 +-\n> > > >  6 files changed, 57 insertions(+), 1 deletion(-)\n> > > >  rename stubs/{qmp_pc_dimm_device_list.c => qmp_pc_dimm.c} (68%)\n> > > >\n> > > > diff --git a/qapi-schema.json b/qapi-schema.json\n> > > > index 802ea53d00..9402ac3b3a 100644\n> > > > --- a/qapi-schema.json\n> > > > +++ b/qapi-schema.json\n> > > > @@ -4407,6 +4407,38 @@\n> > > >    'data': { 'name': 'str', '*migration-safe': 'bool', 'static':\n> > 'bool',\n> > > >              '*unavailable-features': [ 'str' ], 'typename': 'str' } }\n> > > >\n> > > > +##\n> > > > +# @MemoryInfo:\n> > > > +#\n> > > > +# Actual memory information in bytes.\n> > > > +#\n> > > > +# @base-memory: size of \"base\" memory specified with command line\n> > > > +#               option -m.\n> > > > +#\n> > > > +# @plugged-memory: size memory that can be hot-unplugged. This field\n> > > > +#                  is omitted if target does support memory hotplug\n> > > > +#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build\n> > time).\n> > > field description doesn't match what's actually reported.\n> > > s/cat be/is/\n> >\n> > Are you sure about that? That would read:\n> >       size memory that is hot-unplugged\n> >\n> > which doesn't sound right, since it's not be hot-unplugged\n> > yet.\n> >\n> > Dave\n> >\n> > > s/does/doesn't/\n> > >\n> > > > +#\n> > > > +# Since: 2.11.0\n> > > > +##\n> > > > +{ 'struct': 'MemoryInfo',\n> > > > +  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }\n> > > > +\n> > > > +##\n> > > > +# @query-memory-size-summary:\n> > > > +#\n> > > > +# Return the amount of initially allocated and hot-plugged (if\n> > > > +# enabled) memory in bytes.\n> > > it could count dimm's on CLI, so not only hotplugged\n> > >\n> > > s/hot-plugged/present hotpluggable/\n> > >\n> > > > +#\n> > > > +# Example:\n> > > > +#\n> > > > +# -> { \"execute\": \"query-memory-size-summary\" }\n> > > > +# <- { \"return\": { \"base-memory\": 4294967296, \"plugged-memory\": 0 } }\n> > > > +#\n> > > > +# Since: 2.11.0\n> > > > +##\n> > > > +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }\n> > > > +\n> > > >  ##\n> > > >  # @query-cpu-definitions:\n> > > >  #\n> > > > diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h\n> > > > index 6f8c3eb1b3..d83b957829 100644\n> > > > --- a/include/hw/mem/pc-dimm.h\n> > > > +++ b/include/hw/mem/pc-dimm.h\n> > > > @@ -95,6 +95,7 @@ int pc_dimm_get_free_slot(const int *hint, int\n> > max_slots, Error **errp);\n> > > >\n> > > >  int qmp_pc_dimm_device_list(Object *obj, void *opaque);\n> > > >  uint64_t pc_existing_dimms_capacity(Error **errp);\n> > > > +uint64_t get_plugged_memory_size(void);\n> > > >  void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,\n> > > >                           MemoryRegion *mr, uint64_t align, Error\n> > **errp);\n> > > >  void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState\n> > *hpms,\n> > > > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c\n> > > > index bdf6649083..66eace5a5c 100644\n> > > > --- a/hw/mem/pc-dimm.c\n> > > > +++ b/hw/mem/pc-dimm.c\n> > > > @@ -159,6 +159,11 @@ uint64_t pc_existing_dimms_capacity(Error **errp)\n> > > >      return cap.size;\n> > > >  }\n> > > >\n> > > > +uint64_t get_plugged_memory_size(void)\n> > > > +{\n> > > > +    return pc_existing_dimms_capacity(&error_abort);\n> > > > +}\n> > > > +\n> > > >  int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n> > > >  {\n> > > >      MemoryDeviceInfoList ***prev = opaque;\n> > > > diff --git a/qmp.c b/qmp.c\n> > > > index b86201e349..e8c303116a 100644\n> > > > --- a/qmp.c\n> > > > +++ b/qmp.c\n> > > > @@ -709,3 +709,16 @@ ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error\n> > **errp)\n> > > >\n> > > >      return head;\n> > > >  }\n> > > > +\n> > > > +MemoryInfo *qmp_query_memory_size_summary(Error **errp)\n> > > > +{\n> > > > +    MemoryInfo *mem_info = g_malloc0(sizeof(MemoryInfo));\n> > > > +\n> > > > +    mem_info->base_memory = ram_size;\n> > > > +\n> > > > +    mem_info->plugged_memory = get_plugged_memory_size();\n> > > > +    mem_info->has_plugged_memory =\n> > > > +        mem_info->plugged_memory != (uint64_t)-1;\n> > > > +\n> > > > +    return mem_info;\n> > > > +}\n> > > > diff --git a/stubs/qmp_pc_dimm_device_list.c b/stubs/qmp_pc_dimm.c\n> > > > similarity index 68%\n> > > > rename from stubs/qmp_pc_dimm_device_list.c\n> > > > rename to stubs/qmp_pc_dimm.c\n> > > > index def211564d..9ddc4f619a 100644\n> > > > --- a/stubs/qmp_pc_dimm_device_list.c\n> > > > +++ b/stubs/qmp_pc_dimm.c\n> > > > @@ -6,3 +6,8 @@ int qmp_pc_dimm_device_list(Object *obj, void *opaque)\n> > > >  {\n> > > >     return 0;\n> > > >  }\n> > > > +\n> > > > +uint64_t get_plugged_memory_size(void)\n> > > > +{\n> > > > +    return (uint64_t)-1;\n> > > > +}\n> > > > diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs\n> > > > index e69c217aff..f5f139f310 100644\n> > > > --- a/stubs/Makefile.objs\n> > > > +++ b/stubs/Makefile.objs\n> > > > @@ -33,7 +33,7 @@ stub-obj-y += uuid.o\n> > > >  stub-obj-y += vm-stop.o\n> > > >  stub-obj-y += vmstate.o\n> > > >  stub-obj-$(CONFIG_WIN32) += fd-register.o\n> > > > -stub-obj-y += qmp_pc_dimm_device_list.o\n> > > > +stub-obj-y += qmp_pc_dimm.o\n> > > >  stub-obj-y += target-monitor-defs.o\n> > > >  stub-obj-y += target-get-monitor-def.o\n> > > >  stub-obj-y += pc_madt_cpu_entry.o\n> > >\n> > --\n> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK\n> >\n--\nDr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dgilbert@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtG2L2Mk5z9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 21:07:06 +1000 (AEST)","from localhost ([::1]:46949 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsRz6-0005DC-EE\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 07:07:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36307)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dsRyO-0005B4-Re\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 07:06:24 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dsRyK-0000dT-9e\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 07:06:20 -0400","from mx1.redhat.com ([209.132.183.28]:42912)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgilbert@redhat.com>) id 1dsRyK-0000cr-1c\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 07:06:16 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0DB495F73A;\n\tThu, 14 Sep 2017 11:06:15 +0000 (UTC)","from work-vm (ovpn-117-192.ams2.redhat.com [10.36.117.192])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id EF8646758D;\n\tThu, 14 Sep 2017 11:06:10 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 0DB495F73A","Date":"Thu, 14 Sep 2017 12:06:08 +0100","From":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","To":"Vadim Galitsyn <vadim.galitsyn@profitbricks.com>","Message-ID":"<20170914110607.GD3982@work-vm>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<20170829153022.27004-3-vadim.galitsyn@profitbricks.com>\n\t<20170914115746.382cf947@nial.brq.redhat.com>\n\t<20170914102628.GC3982@work-vm>\n\t<CAPHE7NqL1VHz2k_Gep5-eE2HhDy3iQLG9AWa2dRaM9nD9s9uCA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<CAPHE7NqL1VHz2k_Gep5-eE2HhDy3iQLG9AWa2dRaM9nD9s9uCA@mail.gmail.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tThu, 14 Sep 2017 11:06:15 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 2/3] qmp: introduce\n\tquery-memory-size-summary command","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Mohammed Gamal <mohammed.gamal@profitbricks.com>,\n\tEduardo Habkost <ehabkost@redhat.com>,\n\tDavid Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org,\n\tMarkus Armbruster <armbru@redhat.com>,\n\tVasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,\n\tEduardo Otubo <eduardo.otubo@profitbricks.com>,\n\tIgor Mammedov <imammedo@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]