From: Eric Blake <eblake@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.5] block: make 'stats-intervals' a list of integers
Date: Wed, 11 Nov 2015 08:32:42 -0700 [thread overview]
Message-ID: <56435F9A.6010302@redhat.com> (raw)
In-Reply-To: <1447247832-14198-1-git-send-email-berto@igalia.com>
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
On 11/11/2015 06:17 AM, Alberto Garcia wrote:
> This is the natural JSON representation and prevents us from having to
> decode the list manually.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> blockdev.c | 64 ++++++++++++++++++++++++++++++++++----------------
> qapi/block-core.json | 7 +++---
> tests/qemu-iotests/136 | 2 +-
> 3 files changed, 48 insertions(+), 25 deletions(-)
>
> + for (entry = qlist_first(interval_list); entry;
> + entry = qlist_next(entry)) {
> + unsigned length;
> + switch (qobject_type(entry->value)) {
>
> - if (*stats_intervals == '\0') {
> - error_setg(&error, "stats-intervals can't have an empty value");
> - }
> -
> - for (i = 0; !error && intervals[i] != NULL; i++) {
> + case QTYPE_QSTRING: {
> + case QTYPE_QINT: {
Why are we accepting both string and int here, but typing it as 'int' in
qapi? I guess its due to how command line parsing passes in strings
rather than ints?
But that should be okay.
Reviewed-by: Eric Blake <eblake@redhat.com>
We may eventually want to add an alternate type that takes both int and
string from QMP (parsing the port number of server addresses is another
spot that could benefit from such an alternate), but that's a project
for 2.6.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-11-11 15:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 13:17 [Qemu-devel] [PATCH] block: make 'stats-intervals' a list of integers Alberto Garcia
2015-11-11 15:32 ` Eric Blake [this message]
2015-11-11 15:38 ` [Qemu-devel] [PATCH for-2.5] " Alberto Garcia
2015-11-13 10:15 ` [Qemu-devel] [Qemu-block] [PATCH] " Stefan Hajnoczi
2015-11-13 10:50 ` Alberto Garcia
2015-11-16 3:47 ` Stefan Hajnoczi
2015-11-16 3:46 ` Stefan Hajnoczi
2015-11-16 8:28 ` Alberto Garcia
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=56435F9A.6010302@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).