qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v13 2/6] qmp: Use ThrottleLimits structure


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v13 2/6] qmp: Use ThrottleLimits structure
Date: Fri, 13 Oct 2017 09:26:17 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

[adding Markus, and block list]

On 10/13/2017 09:16 AM, Alberto Garcia wrote:
> On Mon 02 Oct 2017 04:33:28 PM CEST, Pradeep Jagadeesh wrote:
>> This patch factors out code to use the ThrottleLimits
>> structure.
> 
>>  { 'struct': 'BlockIOThrottle',
>> -  'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
>> -            'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 
>> 'int',
>> -            '*bps_max': 'int', '*bps_rd_max': 'int',
>> -            '*bps_wr_max': 'int', '*iops_max': 'int',
>> -            '*iops_rd_max': 'int', '*iops_wr_max': 'int',
>> -            '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
>> -            '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
>> -            '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
>> -            '*iops_size': 'int', '*group': 'str' } }
>> +  'base': 'ThrottleLimits',
>> +  'data': { '*device': 'str', '*id': 'str', '*group': 'str' } }
> 
> So BlockIOThrottle used to have parameters named bps_rd and iops_wr, and
> after this patch they become bps-read and iops-write. This breaks the
> API completely, as you can see if you run e.g. iotest 129:
> 
> AssertionError: failed path traversal for "return" in "{u'error': {u'class': 
> u'GenericError', u'desc': u"Parameter 'iops_rd' is unexpected"}}"
> 
> I just checked previous versions of the series and I see that Manos
> already warned you of this in v11:
> 
>    https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04698.html

On the bright side, ThrottleLimits is marked 'since 2.11' (added in
commit 432d889e), meaning it has not yet been released, so we CAN fix
the naming in ThrottleLimits to be compatible with BlockIOThrottle if we
want to share the type, as long as we get it done before the 2.11
release.  It does mean tweaking Manos' code to use compatible names
everywhere, but that may be a wise course of action (we tend to favor
'-' in new API names unless there is a strong reason to use '_'; but
sharing code for maximum back-compat would be a reason to use '_').

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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