Received: from eggs.gnu.org ([2001:4830:134:3::10]:39611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm1dZ-0006K2-Rx for qemu-devel@nongnu.org; Mon, 19 Sep 2016 12:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bm1dX-0008NA-Fl for qemu-devel@nongnu.org; Mon, 19 Sep 2016 12:41:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm1dX-0008Mj-7n for qemu-devel@nongnu.org; Mon, 19 Sep 2016 12:41:43 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 BA49BC04B31B for ; Mon, 19 Sep 2016 16:41:42 +0000 (UTC) From: Markus Armbruster Date: Mon, 19 Sep 2016 18:41:24 +0200 Message-Id: <1474303294-13952-9-git-send-email-armbru@redhat.com> In-Reply-To: <1474303294-13952-1-git-send-email-armbru@redhat.com> References: <1474303294-13952-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 08/18] qapi: export the marshallers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau 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 Message-Id: <20160912091913.15831-9-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- 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.5.5