[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 09/12] qapi: remove the "middle" mode
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v2 09/12] qapi: remove the "middle" mode |
Date: |
Fri, 22 Jul 2016 11:35:25 +0400 |
Hi
On Fri, Jul 22, 2016 at 2:55 AM, Eric Blake <address@hidden> wrote:
> On 07/21/2016 08:00 AM, address@hidden wrote:
>> From: Marc-André Lureau <address@hidden>
>>
>> Now that the register function is always generated, we can
>> remove the so-called "middle" mode from the generator script.
>>
>> Signed-off-by: Marc-André Lureau <address@hidden>
>> ---
>> scripts/qapi-commands.py | 29 +++++------------------------
>> 1 file changed, 5 insertions(+), 24 deletions(-)
>>
>> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
>> index a06a2c4..4754ae0 100644
>> --- a/scripts/qapi-commands.py
>> +++ b/scripts/qapi-commands.py
>> @@ -84,17 +84,8 @@ static void qmp_marshal_output_%(c_name)s(%(c_type)s
>> ret_in, QObject **ret_out,
>>
>>
>> def gen_marshal_proto(name):
>> - ret = 'void qmp_marshal_%s(QDict *args, QObject **ret, Error **errp)' %
>> c_name(name)
>> - if not middle_mode:
>> - ret = 'static ' + ret
>> - return ret
>> -
>> -
>> -def gen_marshal_decl(name):
>> - return mcgen('''
>> -%(proto)s;
>> -''',
>> - proto=gen_marshal_proto(name))
>> + return 'static void qmp_marshal_%s' % c_name(name) + \
>> + '(QDict *args, QObject **ret, Error **errp)'
>
> I'm wondering if this should be:
>
> return mcgen('''
> static void qmp_marshal_%(c_name)s(QDict *args, QObject **ret, Error **errp)
> ''',
> c_name=c_name(name))
>
> for consistency with our other code (I'm not sure why we weren't already
> using mcgen(), though).
yes, it works fine too, and we can simplify a bit the code around.
--
Marc-André Lureau
- Re: [Qemu-devel] [PATCH v2 03/12] monitor: register gen:false commands manually, (continued)
- [Qemu-devel] [PATCH v2 05/12] monitor: register the qapi generated commands, marcandre . lureau, 2016/07/21
- [Qemu-devel] [PATCH v2 07/12] monitor: implement 'qmp_query_commands' without qmp_cmds, marcandre . lureau, 2016/07/21
- [Qemu-devel] [PATCH v2 06/12] monitor: remove mhandler.cmd_new, marcandre . lureau, 2016/07/21
- [Qemu-devel] [PATCH v2 09/12] qapi: remove the "middle" mode, marcandre . lureau, 2016/07/21
- [Qemu-devel] [PATCH v2 08/12] build-sys: remove qmp-commands-old.h, marcandre . lureau, 2016/07/21
- [Qemu-devel] [PATCH v2 10/12] monitor: use qmp_dispatch(), marcandre . lureau, 2016/07/21
- [Qemu-devel] [PATCH v2 11/12] qmp: update qmp_query_spice fallback, marcandre . lureau, 2016/07/21
- [Qemu-devel] [PATCH v2 12/12] Drop qmp-commands.hx, marcandre . lureau, 2016/07/21