Eric Blake <ebl...@redhat.com> writes:

> On 04/13/2016 10:06 AM, Markus Armbruster wrote:
>> Eric Blake <ebl...@redhat.com> writes:
>> 
>>> Commit e8316d7 mistakenly passed consume=true
>> 
>> in qmp_input_optional(), right?
>
> yes
>
>> 
>>>                                               when checking if
>>> an optional member was present, but the mistake was silently
>>> ignored since the code happily let us extract a member more than
>>> once.  Tighten up the input visitor to ensure that a member is
>>> consumed exactly once.
>
> [1] by fixing qmp_input_optional() to pass consume=false
>
>>>  To keep the testsuite happy in the case
>>> of incomplete input, we have to check whether a member exists
>>> in the dictionary before trying to remove it.
>> 
>> Sure this is only for the testsuite's benefit?
>
> The testsuite was the only client that failed under the tighter
> semantics; but the better semantics allow later patches to further
> improve the code while guaranteeing that clients remain sane.

Do we know that non-testsuite code can't fail for some input?

>> 
>> You fix commit e8316d7's incorrect consume=true, don't you?  Recommend
>> to mention that explicitly.
>
> I thought I did, but I can add wording [1] along those lines.

Reply via email to