Received: from eggs.gnu.org ([2001:4830:134:3::10]:53233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFsCA-0003fo-2x for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFsC3-0004Qg-Cg for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFsC3-0004QR-70 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:27 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 E4399C0467C8 for ; Thu, 23 Jun 2016 00:08:26 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Thu, 23 Jun 2016 02:08:06 +0200 Message-Id: <20160623000809.4522-10-marcandre.lureau@redhat.com> In-Reply-To: <20160623000809.4522-1-marcandre.lureau@redhat.com> References: <20160623000809.4522-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 09/12] qapi: remove the "middle" mode 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?= From: Marc-Andr=C3=A9 Lureau 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=C3=A9 Lureau --- 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 8d25701..70a07b3 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 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 - - -def gen_marshal_decl(name): - return mcgen(''' -%(proto)s; -''', - proto=3Dgen_marshal_proto(name)) + return 'static void qmp_marshal_%s' % c_name(name) + \ + '(QDict *args, QObject **ret, Error **errp)' =20 =20 def gen_marshal(name, arg_type, box, ret_type): @@ -209,8 +200,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor): self._visited_ret_types =3D set() =20 def visit_end(self): - if not middle_mode: - self.defn +=3D gen_registry(self._regy) + self.defn +=3D gen_registry(self._regy) self._regy =3D None self._visited_ret_types =3D None =20 @@ -222,21 +212,12 @@ 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.defn +=3D gen_marshal(name, arg_type, box, ret_type) - if not middle_mode: - self._regy +=3D gen_register_command(name, success_response) - + self._regy +=3D gen_register_command(name, success_response) =20 -middle_mode =3D False =20 (input_file, output_dir, do_c, do_h, prefix, opts) =3D \ - parse_command_line("m", ["middle"]) - -for o, a in opts: - if o in ("-m", "--middle"): - middle_mode =3D True + parse_command_line() =20 c_comment =3D ''' /* --=20 2.9.0