From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Vzj-0003zK-RC for qemu-devel@nongnu.org; Mon, 15 Jun 2015 11:08:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Vze-0000Gh-8l for qemu-devel@nongnu.org; Mon, 15 Jun 2015 11:08:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Vze-0000GX-1T for qemu-devel@nongnu.org; Mon, 15 Jun 2015 11:08:10 -0400 Date: Mon, 15 Jun 2015 16:08:07 +0100 From: Stefan Hajnoczi Message-ID: <20150615150807.GD12553@stefanha-thinkpad.redhat.com> References: <1434205258-1932-1-git-send-email-armbru@redhat.com> <1434205258-1932-8-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cHMo6Wbp1wrKhbfi" Content-Disposition: inline In-Reply-To: <1434205258-1932-8-git-send-email-armbru@redhat.com> Subject: Re: [Qemu-devel] [PATCH 07/11] qmp: Wean off qerror_report() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: mdroth@linux.vnet.ibm.com, kwolf@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com --cHMo6Wbp1wrKhbfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 13, 2015 at 04:20:54PM +0200, Markus Armbruster wrote: > The traditional QMP command handler interface >=20 > int qmp_FOO(Monitor *mon, const QDict *params, QObject **ret_data); >=20 > doesn't provide for returning an Error object. Instead, the handler > is expected to stash it in the monitor with qerror_report(). >=20 > When we rebased QMP on top of QAPI, we didn't change this interface. > Instead, commit 776574d introduced "middle mode" as a temporary aid > for converting existing QMP commands to QAPI one by one. More than > three years later, we're still using it. >=20 > Middle mode has two effects: >=20 > * Instead of the native input marshallers >=20 > static void qmp_marshal_input_FOO(QDict *, QObject **, Error **) >=20 > it generates input marshallers conforming to the traditional QMP > command handler interface. >=20 > * It suppresses generation of code to register them with > qmp_register_command() >=20 > This permits giving them internal linkage. >=20 > As long as we need qmp-commands.hx, we can't use the registry behind > qmp_register_command(), so the latter has to stay for now. >=20 > The former has to go to get rid of qerror_report(). Changing all QMP > commands to fit the QAPI mold in one go was impractical back when we > started, but by now there are just a few stragglers left: > do_qmp_capabilities(), qmp_qom_set(), qmp_qom_get(), qmp_object_add(), > qmp_netdev_add(), do_device_add(). >=20 > Switch middle mode to generate native input marshallers, and adapt the > stragglers. Simplifies both the monitor code and the stragglers. >=20 > Rename do_qmp_capabilities() to qmp_capabilities(), and > do_device_add() to qmp_device_add, because that's how QMP command > handlers are named today. >=20 > Signed-off-by: Markus Armbruster > --- > hmp.c | 5 ++++- > include/monitor/monitor.h | 7 +++--- > include/monitor/qdev.h | 3 ++- > include/net/net.h | 2 +- > monitor.c | 24 ++++++--------------- > net/net.c | 16 ++++++-------- > qdev-monitor.c | 15 ++++++------- > qmp-commands.hx | 4 ++-- > qmp.c | 55 +++++++++++------------------------------= ------ > scripts/qapi-commands.py | 41 ++++++----------------------------- > util/qemu-error.c | 4 ++-- > 11 files changed, 50 insertions(+), 126 deletions(-) Net portions look good. Reviewed-by: Stefan Hajnoczi --cHMo6Wbp1wrKhbfi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVfupXAAoJEJykq7OBq3PIl1MIALZXnGlR0zFLJdwBs25dQgZg y2Til7K44ziW3AuCX0b5VichpqxdvbOzKCqtyhy7UNGVFo6lmK3mFyNWBfiPr6CB jcFjUv0oJAit+WLC+TKZP+v4FvsnmyRkzxtF3LtM40dNlXnBqj9r+j1rVhf/DLs5 5k1uwFKlxKQZB31xy1PDGC2PJGzI/8hIRLWwYPOytOck1Ps+jCpeoglBun8B0Z03 oirAqUE9BCqiKzubbR+Sf88BaSVj2As2XR9+i+SGksbDI2N+2xPdPk3gvS4Z0c7V +Fw3ZiJ0YhXEp2P4S2wXm8WlaOjlLpQYL3csSAFQtm4xOvBhbUNuTl+64MAZzqw= =NknO -----END PGP SIGNATURE----- --cHMo6Wbp1wrKhbfi--