From: Luiz Capitulino <lcapitulino@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Juan Quintela <quintela@redhat.com>,
Markus@gnu.org, qemu-devel@nongnu.org,
Armbruster <armbru@redhat.com>, Blue Swirl <blauwirbel@gmail.com>,
Avi Kivity <avi@redhat.com>, Jan Kiszka <jan.kiszka@siemens.com>
Subject: [Qemu-devel] Re: [PATCH v3 13/17] monitor: Allow to exclude commands from QMP
Date: Thu, 27 May 2010 17:31:47 -0300 [thread overview]
Message-ID: <20100527173147.304ee68b@redhat.com> (raw)
In-Reply-To: <5d0139dc62706a1efcbb6a63d5936484ad279916.1274612367.git.jan.kiszka@web.de>
On Sun, 23 May 2010 12:59:26 +0200
Jan Kiszka <jan.kiszka@web.de> wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Ported commands that are marked 'user_only' will not be considered for
> QMP monitor sessions. This allows to implement new commands that do not
> (yet) provide a sufficiently stable interface for QMP use (e.g.
> device_show).
This is fine for me, but two things I've been wondering:
1. Isn't a 'flags' struct member better? So that we can do (in the
qemu-monitor.hx entry):
.flags = MONITOR_USER_ONLY | MONITOR_HANDLER_ASYNC,
I'm not suggesting this is an async handler, just exemplifying multiple
flags.
2. Getting QMP handlers right in the first time might be difficult, so
we could have a way to mark them unstable. Maybe a different namespace
which is only enabled at configure time with:
--enable-qmp-unstable-commands
If this were possible, we could have device_show and any command we
aren't sure is QMP-ready working in QMP this way.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> monitor.c | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index 6766e49..5768c6e 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -114,6 +114,7 @@ typedef struct mon_cmd_t {
> MonitorCompletion *cb, void *opaque);
> } mhandler;
> int async;
> + bool user_only;
> } mon_cmd_t;
>
> /* file descriptors passed via SCM_RIGHTS */
> @@ -635,6 +636,11 @@ static int do_info(Monitor *mon, const QDict *qdict, QObject **ret_data)
> goto help;
> }
>
> + if (monitor_ctrl_mode(mon) && cmd->user_only) {
> + qerror_report(QERR_COMMAND_NOT_FOUND, item);
> + return -1;
> + }
> +
> if (monitor_handler_is_async(cmd)) {
> if (monitor_ctrl_mode(mon)) {
> qmp_async_info_handler(mon, cmd);
> @@ -732,13 +738,14 @@ static void do_info_commands(Monitor *mon, QObject **ret_data)
> cmd_list = qlist_new();
>
> for (cmd = mon_cmds; cmd->name != NULL; cmd++) {
> - if (monitor_handler_ported(cmd) && !compare_cmd(cmd->name, "info")) {
> + if (monitor_handler_ported(cmd) && !cmd->user_only &&
> + !compare_cmd(cmd->name, "info")) {
> qlist_append_obj(cmd_list, get_cmd_dict(cmd->name));
> }
> }
>
> for (cmd = info_cmds; cmd->name != NULL; cmd++) {
> - if (monitor_handler_ported(cmd)) {
> + if (monitor_handler_ported(cmd) && !cmd->user_only) {
> char buf[128];
> snprintf(buf, sizeof(buf), "query-%s", cmd->name);
> qlist_append_obj(cmd_list, get_cmd_dict(buf));
> @@ -4416,7 +4423,7 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
> qobject_from_jsonf("{ 'item': %s }", info_item));
> } else {
> cmd = monitor_find_command(cmd_name);
> - if (!cmd || !monitor_handler_ported(cmd)) {
> + if (!cmd || !monitor_handler_ported(cmd) || cmd->user_only) {
> qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
> goto err_input;
> }
next prev parent reply other threads:[~2010-05-27 20:31 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-23 10:59 [Qemu-devel] [PATCH v3 00/17] Basic device state visualization Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 01/17] Add dependency of JSON unit tests on config-host.h Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 02/17] qdev: Fix scanning across single-bus devices Jan Kiszka
2010-06-03 5:58 ` Paul Brook
2010-06-03 6:12 ` Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 03/17] qdev: Allow device addressing via 'driver.instance' Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 04/17] qdev: Give qtree names precedence over user-assigned IDs Jan Kiszka
2010-05-29 8:01 ` Markus Armbruster
2010-05-30 8:16 ` Avi Kivity
2010-05-31 8:26 ` Markus Armbruster
2010-05-31 9:59 ` Gerd Hoffmann
2010-05-31 11:12 ` Markus Armbruster
2010-05-31 14:13 ` [Qemu-devel] [PATCH] qdev: Reject duplicate and anti-social device IDs Markus Armbruster
2010-05-31 18:55 ` [Qemu-devel] " Gerd Hoffmann
2010-06-01 13:04 ` Luiz Capitulino
2010-06-01 13:09 ` Jan Kiszka
2010-06-01 13:13 ` Luiz Capitulino
2010-06-01 13:19 ` Jan Kiszka
2010-06-01 13:21 ` Avi Kivity
2010-06-01 13:23 ` Luiz Capitulino
2010-06-01 14:44 ` Markus Armbruster
2010-06-01 14:49 ` Luiz Capitulino
2010-06-01 18:35 ` Markus Armbruster
2010-06-01 18:54 ` Anthony Liguori
2010-06-03 6:26 ` Jan Kiszka
2010-06-03 6:51 ` [Qemu-devel] " Paul Brook
2010-06-04 14:27 ` Markus Armbruster
2010-06-04 15:28 ` Paul Brook
2010-06-08 12:06 ` Markus Armbruster
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 05/17] qdev: Convert device and bus lists to QTAILQ Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 06/17] qdev: Allow device specification by qtree path for device_del Jan Kiszka
2010-05-27 19:36 ` [Qemu-devel] " Luiz Capitulino
2010-05-27 22:19 ` Jan Kiszka
2010-05-28 13:43 ` Luiz Capitulino
2010-05-28 14:16 ` Jan Kiszka
2010-05-28 14:40 ` Markus Armbruster
2010-05-28 14:56 ` Jan Kiszka
2010-05-29 8:05 ` Markus Armbruster
2010-05-29 8:16 ` Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 07/17] qdev: Push QMP mode checks into qbus_list_bus/dev Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 08/17] monitor: Add completion for qdev paths Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 09/17] Add base64 encoder/decoder Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 10/17] QMP: Reserve namespace for complex object classes Jan Kiszka
2010-05-27 20:08 ` [Qemu-devel] " Luiz Capitulino
2010-05-27 22:20 ` Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 11/17] Add QBuffer Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 12/17] monitor: return length of printed string via monitor_[v]printf Jan Kiszka
2010-05-29 8:09 ` Markus Armbruster
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 13/17] monitor: Allow to exclude commands from QMP Jan Kiszka
2010-05-27 20:31 ` Luiz Capitulino [this message]
2010-05-27 22:20 ` [Qemu-devel] " Jan Kiszka
2010-05-28 13:45 ` Luiz Capitulino
2010-05-29 8:15 ` Markus Armbruster
2010-05-29 8:33 ` Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 14/17] monitor: Add basic device state visualization Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 15/17] QMP: Teach basic capability negotiation to python example Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 16/17] QMP: Fix python helper /wrt long return strings Jan Kiszka
2010-05-27 20:35 ` [Qemu-devel] " Luiz Capitulino
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 17/17] QMP: Add support for buffer class to qmp python helper Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100527173147.304ee68b@redhat.com \
--to=lcapitulino@redhat.com \
--cc=Markus@gnu.org \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=jan.kiszka@siemens.com \
--cc=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).