[{"id":1768484,"web_url":"http://patchwork.ozlabs.org/comment/1768484/","msgid":"<20170914120039.5100b63d@nial.brq.redhat.com>","list_archive_url":null,"date":"2017-09-14T10:00:39","subject":"Re: [Qemu-devel] [PATCH v7 3/3] hmp: introduce 'info\n\tmemory_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:22 +0200\nVadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:\n\n> Add 'info memory_size_summary' command which is a sibling\n> of QMP command query-memory-size-summary. It 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>  hmp.h                |  1 +\n>  hmp.c                | 18 ++++++++++++++++++\n>  hmp-commands-info.hx | 16 ++++++++++++++++\n>  3 files changed, 35 insertions(+)\n> \n> diff --git a/hmp.h b/hmp.h\n> index 1ff455295e..3605003e4c 100644\n> --- a/hmp.h\n> +++ b/hmp.h\n> @@ -145,5 +145,6 @@ void hmp_info_dump(Monitor *mon, const QDict *qdict);\n>  void hmp_info_ramblock(Monitor *mon, const QDict *qdict);\n>  void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);\n>  void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);\n> +void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict);\n>  \n>  #endif\n> diff --git a/hmp.c b/hmp.c\n> index fd80dce758..b718dab4df 100644\n> --- a/hmp.c\n> +++ b/hmp.c\n> @@ -2868,3 +2868,21 @@ void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict)\n>      hmp_handle_error(mon, &err);\n>      qapi_free_GuidInfo(info);\n>  }\n> +\n> +void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict)\n> +{\n> +    Error *err = NULL;\n> +    MemoryInfo *info = qmp_query_memory_size_summary(&err);\n> +    if (info) {\n> +        monitor_printf(mon, \"base memory: %\" PRIu64 \"\\n\",\n> +                       info->base_memory);\n> +\n> +        if (info->has_plugged_memory) {\n> +            monitor_printf(mon, \"plugged memory: %\" PRIu64 \"\\n\",\n> +                           info->plugged_memory);\n> +        }\n> +\n> +        qapi_free_MemoryInfo(info);\n> +    }\n> +    hmp_handle_error(mon, &err);\n> +}\n> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx\n> index d9df238a5f..04c9db81f6 100644\n> --- a/hmp-commands-info.hx\n> +++ b/hmp-commands-info.hx\n> @@ -849,6 +849,22 @@ ETEXI\n>          .cmd = hmp_info_vm_generation_id,\n>      },\n>  \n> +STEXI\n> +@item info memory_size_summary\n> +@findex memory_size_summary\n> +Display the amount of initially allocated and hot-plugged (if\ns/hot-plugged/present hotpluggable/\n\n> +enabled) memory in bytes.\n> +ETEXI\n> +\n> +    {\n> +        .name       = \"memory_size_summary\",\n> +        .args_type  = \"\",\n> +        .params     = \"\",\n> +        .help       = \"show the amount of initially allocated and \"\n> +                      \"hot-plugged (if enabled) memory in bytes.\",\nditto\n\n> +        .cmd        = hmp_info_memory_size_summary,\n> +    },\n> +\n>  STEXI\n>  @end table\n>  ETEXI","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-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.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 3xtDZZ04SFz9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 20:01:26 +1000 (AEST)","from localhost ([::1]:46684 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 1dsQxY-0004PK-6J\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 06:01:24 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:58943)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsQx8-0004OO-FM\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:01:02 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsQwy-0004qN-GT\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:00:58 -0400","from mx1.redhat.com ([209.132.183.28]:43940)\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 1dsQwy-0004pd-0c\n\tfor qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:00:48 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\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 E9BC9356C0;\n\tThu, 14 Sep 2017 10:00:46 +0000 (UTC)","from nial.brq.redhat.com (unknown [10.43.2.209])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 834105D963;\n\tThu, 14 Sep 2017 10:00:40 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com E9BC9356C0","Date":"Thu, 14 Sep 2017 12:00:39 +0200","From":"Igor Mammedov <imammedo@redhat.com>","To":"Vadim Galitsyn <vadim.galitsyn@profitbricks.com>","Message-ID":"<20170914120039.5100b63d@nial.brq.redhat.com>","In-Reply-To":"<20170829153022.27004-4-vadim.galitsyn@profitbricks.com>","References":"<20170829153022.27004-1-vadim.galitsyn@profitbricks.com>\n\t<20170829153022.27004-4-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.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tThu, 14 Sep 2017 10:00:47 +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 3/3] hmp: introduce 'info\n\tmemory_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>"}}]