qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v13 02/17] qmp: Ensure consistent granularity ty


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v13 02/17] qmp: Ensure consistent granularity type
Date: Mon, 16 Feb 2015 13:03:34 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/13/2015 03:08 PM, John Snow wrote:
> We treat this field with a variety of different types everywhere
> in the code. Now it's just uint32_t.
> 
> Signed-off-by: John Snow <address@hidden>
> ---
>  block.c                   | 11 ++++++-----
>  block/mirror.c            |  4 ++--
>  include/block/block.h     |  2 +-
>  include/block/block_int.h |  2 +-
>  qapi/block-core.json      |  2 +-
>  5 files changed, 11 insertions(+), 10 deletions(-)
> 

> +++ b/qapi/block-core.json
> @@ -335,7 +335,7 @@
>  # Since: 1.3
>  ##
>  { 'type': 'BlockDirtyInfo',
> -  'data': {'*name': 'str', 'count': 'int', 'granularity': 'int'} }
> +  'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32'} }

The wire format of QMP is unchanged. Prior to this patch, a user could
pass a value larger than 4G and get past initial validation, but as
other code then capped the value (for example, drive-mirror caps at a
maximum of 64M), we aren't changing working semantics.  Narrowing a type
is not always backwards-compatible, but in this case it looks fine.  So:

Reviewed-by: Eric Blake <address@hidden>

-- 
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

[Prev in Thread] Current Thread [Next in Thread]