Hi On Fri, Jul 22, 2016 at 2:55 AM, Eric Blake <ebl...@redhat.com> wrote: > On 07/21/2016 08:00 AM, marcandre.lur...@redhat.com wrote: >> From: Marc-André Lureau <marcandre.lur...@redhat.com> >> >> 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 <marcandre.lur...@redhat.com> >> --- >> 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