From mboxrd@z Thu Jan 1 00:00:00 1970 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 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> Subject: [Qemu-devel] [PATCH 5/8] QMP: Introduce qmp_capability_enable/disable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@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 -- 1.6.6