[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 07/37] qapi: Improve generated event use of q
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v9 07/37] qapi: Improve generated event use of qapi visitor |
Date: |
Thu, 28 Jan 2016 15:51:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 01/20/2016 08:19 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> All other successful clients of visit_start_struct() were paired
>> with an unconditional visit_end_struct(); but the generated
>> code for events was relying on qmp_output_visitor_cleanup() to
>> work on an incomplete visit.
>
>> +++ b/scripts/qapi.py
>> @@ -1636,7 +1636,8 @@ def gen_err_check(label='out', skiperr=False):
>> label=label)
>>
>>
>> -def gen_visit_fields(members, prefix='', need_cast=False, skiperr=False):
>> +def gen_visit_fields(members, prefix='', need_cast=False, skiperr=False,
>> + label='out'):
>
> Probably clearer than label=None, but duplicates gen_err_check()'s
> default. Fine with me.
Use of label=None resulted in literal "goto None;" in the generated file
(Python stringized it, rather than treating it as a hint to behave as if
the argument were not supplied). So yes, I had to duplicate the default
value in both methods, to avoid having to do 'if label:' within the
implementations.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v9 03/37] qapi: Drop dead dealloc visitor variable, Eric Blake, 2016/01/19
[Qemu-devel] [PATCH v9 01/37] qobject: Document more shortcomings in our number handling, Eric Blake, 2016/01/19