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 <be...@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 <ebl...@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: signature.asc
Description: OpenPGP digital signature

Reply via email to