Received: from eggs.gnu.org ([2001:4830:134:3::10]:40780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba4Aq-0005Y8-Nk for qemu-devel@nongnu.org; Wed, 17 Aug 2016 12:58:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ba4Ao-0002Xm-S1 for qemu-devel@nongnu.org; Wed, 17 Aug 2016 12:58:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba4Ao-0002Xf-Mb for qemu-devel@nongnu.org; Wed, 17 Aug 2016 12:58:38 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3AA463B71E for ; Wed, 17 Aug 2016 16:58:38 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 17 Aug 2016 20:57:48 +0400 Message-Id: <20160817165757.23486-12-marcandre.lureau@redhat.com> In-Reply-To: <20160817165757.23486-1-marcandre.lureau@redhat.com> References: <20160817165757.23486-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v5 11/20] qapi: export the marshallers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Make it possible to call marshallers manually, without going through qmp_dispatch(). (this is currently only possible in middle-mode, but it's also useful in general) Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi-commands.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index a06a2c4..b150db9 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -84,10 +84,7 @@ static void qmp_marshal_output_%(c_name)s(%(c_type)s r= et_in, QObject **ret_out, =20 =20 def gen_marshal_proto(name): - ret =3D 'void qmp_marshal_%s(QDict *args, QObject **ret, Error **err= p)' % c_name(name) - if not middle_mode: - ret =3D 'static ' + ret - return ret + return 'void qmp_marshal_%s(QDict *args, QObject **ret, Error **errp= )' % c_name(name) =20 =20 def gen_marshal_decl(name): @@ -222,8 +219,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor): if ret_type and ret_type not in self._visited_ret_types: self._visited_ret_types.add(ret_type) self.defn +=3D gen_marshal_output(ret_type) - if middle_mode: - self.decl +=3D gen_marshal_decl(name) + self.decl +=3D gen_marshal_decl(name) self.defn +=3D gen_marshal(name, arg_type, boxed, ret_type) if not middle_mode: self._regy +=3D gen_register_command(name, success_response) --=20 2.9.0