qemu-devel
[Top][All Lists]
Advanced

[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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 09/12] qapi: remove the "middle" mode
Date: Thu, 21 Jul 2016 16:55:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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

Otherwise, nice to see it go!

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