From patchwork Thu Jan 28 13:42:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 43863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5C63B7CFB for ; Fri, 29 Jan 2010 00:53:13 +1100 (EST) Received: from localhost ([127.0.0.1]:46359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaUo0-0004IW-Bk for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2010 08:53:08 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaUei-0000Mu-H3 for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaUeb-0000Jr-Ql for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:30 -0500 Received: from [199.232.76.173] (port=57170 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaUeb-0000JP-Il for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57678) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaUea-0003xv-0M for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:24 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0SDhNQO000369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Jan 2010 08:43:23 -0500 Received: from localhost (vpn-10-249.rdu.redhat.com [10.11.10.249]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0SDhLWV010841 for ; Thu, 28 Jan 2010 08:43:22 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 28 Jan 2010 11:42:57 -0200 Message-Id: <1264686180-29845-6-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1264686180-29845-1-git-send-email-lcapitulino@redhat.com> References: <1264686180-29845-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 5/8] QMP: Introduce qmp_capability_enable/disable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As we don't have any capabilities yet, they always return an InvalidParameter error. Please, also note that: o They don't accept an json-array yet, because this would require not so simple changes and it's not useful right now o We will need more infrastructure to have capabilities per Monitor, which is not going to be done now as we don't need this yet either Usage example: { "execute": "qmp_capability_enable", "arguments": { "name": "foo" } } Signed-off-by: Luiz Capitulino --- monitor.c | 14 ++++++++++++++ qemu-monitor.hx | 30 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 0 deletions(-) diff --git a/monitor.c b/monitor.c index f6dd64d..9070a0c 100644 --- a/monitor.c +++ b/monitor.c @@ -730,6 +730,20 @@ static void do_qmp_switch_mode(Monitor *mon, const QDict *qdict, } } +static void do_qmp_capability_enable(Monitor *mon, const QDict *qdict, + QObject **ret_data) +{ + /* QMP doesn't have any capabilities yet */ + qemu_error_new(QERR_INVALID_PARAMETER, "name"); +} + +static void do_qmp_capability_disable(Monitor *mon, const QDict *qdict, + QObject **ret_data) +{ + /* QMP doesn't have any capabilities yet */ + qemu_error_new(QERR_INVALID_PARAMETER, "name"); +} + /** * do_info_commands(): List QMP available commands * diff --git a/qemu-monitor.hx b/qemu-monitor.hx index 29155ce..8905986 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -1079,6 +1079,36 @@ STEXI Switch QMP to @var{mode} ETEXI + { + .name = "qmp_capability_enable", + .args_type = "name:s", + .params = "name", + .help = "enable a QMP capability", + .flags = HANDLER_HANDSHAKE_ONLY, + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_qmp_capability_enable, + }, + +STEXI +@item qmp_capability_enable @var{name} +Enable QMP capability @{name} +ETEXI + + { + .name = "qmp_capability_disable", + .args_type = "name:s", + .params = "name", + .help = "disable a QMP capability", + .flags = HANDLER_HANDSHAKE_ONLY, + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_qmp_capability_disable, + }, + +STEXI +@item qmp_capability_disable @var{name} +Disable QMP capability @{name} +ETEXI + STEXI @end table ETEXI