From patchwork Thu Jul 21 14:00:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 651193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rwFvW5806z9sdn for ; Fri, 22 Jul 2016 00:06:47 +1000 (AEST) Received: from localhost ([::1]:41026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQEcf-0003Cx-EK for incoming@patchwork.ozlabs.org; Thu, 21 Jul 2016 10:06:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQEWm-0006zS-PO for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:00:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQEWk-0005La-5n for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:00:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQEWj-0005LK-Vr for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:00:38 -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 5365C796FB for ; Thu, 21 Jul 2016 14:00:37 +0000 (UTC) Received: from localhost (ovpn-116-196.phx2.redhat.com [10.3.116.196]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6LE0ZEO023586; Thu, 21 Jul 2016 10:00:36 -0400 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Thu, 21 Jul 2016 18:00:19 +0400 Message-Id: <20160721140030.28383-2-marcandre.lureau@redhat.com> In-Reply-To: <20160721140030.28383-1-marcandre.lureau@redhat.com> References: <20160721140030.28383-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 21 Jul 2016 14:00:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 01/12] qapi-schema: use generated marshaller for 'qmp_capabilities' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau qapi'fy the 'qmp_capabilities' command. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster --- monitor.c | 4 ++-- qapi-schema.json | 21 +++++++++++++++++++++ qmp-commands.hx | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 5d68a5d..cb1a0c7 100644 --- a/monitor.c +++ b/monitor.c @@ -617,7 +617,7 @@ static void monitor_qapi_event_init(void) qmp_event_set_func_emit(monitor_qapi_event_queue); } -static void qmp_capabilities(QDict *params, QObject **ret_data, Error **errp) +void qmp_qmp_capabilities(Error **errp) { cur_mon->qmp.in_command_mode = true; } @@ -3649,7 +3649,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 = cmd->mhandler.cmd_new == qmp_capabilities; + bool is_cap = cmd->mhandler.cmd_new == qmp_marshal_qmp_capabilities; 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 5658723..03c15d8 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -20,6 +20,27 @@ # QAPI introspection { 'include': 'qapi/introspect.json' } +## +# @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 the +# monitor is accepting other commands. +# +# Since: 0.13 +# +## +{ 'command': 'qmp_capabilities' } + ## # @LostTickPolicy: # diff --git a/qmp-commands.hx b/qmp-commands.hx index c8d360a..13707ac 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -2209,7 +2209,7 @@ EQMP .args_type = "", .params = "", .help = "enable QMP capabilities", - .mhandler.cmd_new = qmp_capabilities, + .mhandler.cmd_new = qmp_marshal_qmp_capabilities, }, SQMP