From: Eric Blake <eblake@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>,
Vadim Galitsyn <vadim.galitsyn@profitbricks.com>
Cc: Mohammed Gamal <mohammed.gamal@profitbricks.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,
Eduardo Otubo <eduardo.otubo@profitbricks.com>
Subject: Re: [Qemu-devel] [PATCH v3] hmp, qmp: introduce "info memory" and "query-memory" commands
Date: Tue, 27 Jun 2017 09:14:44 -0500 [thread overview]
Message-ID: <4a4aa9ac-39d2-c549-4955-0d18fa30fd14@redhat.com> (raw)
In-Reply-To: <20170627160512.705f6d8e@nial.brq.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]
On 06/27/2017 09:05 AM, Igor Mammedov wrote:
> On Wed, 14 Jun 2017 17:21:06 +0200
> Vadim Galitsyn <vadim.galitsyn@profitbricks.com> wrote:
>
>> +void hmp_info_memory(Monitor *mon, const QDict *qdict)
>> +{
>> + Error *err = NULL;
>> + MemoryInfo *info = qmp_query_memory(&err);
>> + if (info) {
>> + monitor_printf(mon, "base-memory: %" PRIu64 "\n",
>> + info->base_memory);
>> + monitor_printf(mon, "hot-plug-memory: %" PRIu64 "\n",
>> + info->hot_plug_memory);
> it shouldn't be printed if hotplug is not enabled
In which case, the QAPI change in the .json file should mark it as
'*hot-plug-memory', to make it an optional field, and you'll need to
check/set info->has_hot_plug_memory as appropriate.
>
>> + monitor_printf(mon, "ballooned-actual-memory: %" PRIu64 "\n",
>> + info->ballooned_actual_memory);
>> + g_free(info);
>
> probably there is autogenerated qapi_free_FOO() for MemInfo type
Yes, there is.
> since it's QAPI type, it should be used here instead of g_free() if it exists.
Yes, that is correct.
>> +#
>> +# @ballooned-actual-memory: amount of guest memory available after ballooning.
>> +#
>> +# Since: 2.10.0
>> +##
>> +{ 'struct': 'MemoryInfo',
>> + 'data' : { 'base-memory': 'int',
>> 'hot-plug-memory': 'int',
> should be optional and shown only if hotplug is actually enabled
>
>> + 'ballooned-actual-memory': 'int' } }
> maybe the same for ballooning
Yes, that makes sense to have both of those stats be optional, since
they are opt-in configurations.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-06-27 14:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 15:21 [Qemu-devel] [PATCH v3] hmp, qmp: introduce "info memory" and "query-memory" commands Vadim Galitsyn
2017-06-14 15:51 ` no-reply
2017-06-27 14:05 ` Igor Mammedov
2017-06-27 14:14 ` Eric Blake [this message]
2017-06-30 14:00 ` Vadim Galitsyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a4aa9ac-39d2-c549-4955-0d18fa30fd14@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eduardo.otubo@profitbricks.com \
--cc=imammedo@redhat.com \
--cc=mohammed.gamal@profitbricks.com \
--cc=qemu-devel@nongnu.org \
--cc=vadim.galitsyn@profitbricks.com \
--cc=vasilis.liaskovitis@profitbricks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).