Received: from eggs.gnu.org ([2001:4830:134:3::10]:53105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFsBw-0003Vf-Ef for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFsBp-0004LG-8J for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFsBp-0004L7-1x for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:13 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 AC80E83F45 for ; Thu, 23 Jun 2016 00:08:12 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Thu, 23 Jun 2016 02:07:58 +0200 Message-Id: <20160623000809.4522-2-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 01/12] qapi-schema: use generated marshaller for 'qmp_capabilities' 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 qapi'fy the 'qmp_capabilities' command. Signed-off-by: Marc-Andr=C3=A9 Lureau --- monitor.c | 4 ++-- qapi-schema.json | 19 +++++++++++++++++++ qmp-commands.hx | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index bbd5134..63f7086 100644 --- a/monitor.c +++ b/monitor.c @@ -615,7 +615,7 @@ static void monitor_qapi_event_init(void) qmp_event_set_func_emit(monitor_qapi_event_queue); } =20 -static void qmp_capabilities(QDict *params, QObject **ret_data, Error **= errp) +void qmp_qmp_capabilities(Error **errp) { cur_mon->qmp.in_command_mode =3D true; } @@ -3601,7 +3601,7 @@ static int monitor_can_read(void *opaque) static bool invalid_qmp_mode(const Monitor *mon, const mon_cmd_t *cmd, Error **errp) { - bool is_cap =3D cmd->mhandler.cmd_new =3D=3D qmp_capabilities; + bool is_cap =3D cmd->mhandler.cmd_new =3D=3D qmp_marshal_qmp_capabil= ities; =20 if (is_cap && mon->qmp.in_command_mode) { error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND, diff --git a/qapi-schema.json b/qapi-schema.json index 511c98b..73f0b6f 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -20,6 +20,25 @@ # QAPI introspection { 'include': 'qapi/introspect.json' } =20 +## +# @qmp_capabilities: +# +# Enable QMP capabilities. +# +# Arguments: None. +# +# Example: +# +# -> { "execute": "qmp_capabilities" } +# <- { "return": {} } +# +# Notes: This command is valid exactly when first connecting: it must be +# issued before any other command will be accepted, and will fail once t= he +# monitor is accepting other commands. +# +## +{ 'command': 'qmp_capabilities' } + ## # @LostTickPolicy: # diff --git a/qmp-commands.hx b/qmp-commands.hx index 09b1e38..ee88e48 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -2197,7 +2197,7 @@ EQMP .args_type =3D "", .params =3D "", .help =3D "enable QMP capabilities", - .mhandler.cmd_new =3D qmp_capabilities, + .mhandler.cmd_new =3D qmp_marshal_qmp_capabilities, }, =20 SQMP --=20 2.9.0