From e3193601c84558c303b1773379da76fce80c0a56 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 2 Sep 2011 12:34:47 -0500 Subject: qapi: use middle mode in QMP server Use the new middle mode within the existing QMP server. Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- monitor.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index d323ea5851..e267d5899c 100644 --- a/monitor.c +++ b/monitor.c @@ -122,6 +122,7 @@ typedef struct mon_cmd_t { int (*cmd_async)(Monitor *mon, const QDict *params, MonitorCompletion *cb, void *opaque); } mhandler; + bool qapi; int flags; } mon_cmd_t; @@ -3182,7 +3183,7 @@ static const mon_cmd_t info_cmds[] = { }; static const mon_cmd_t qmp_cmds[] = { -#include "qmp-commands.h" +#include "qmp-commands-old.h" { /* NULL */ }, }; @@ -5107,12 +5108,10 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens) goto err_out; } - if (strstart(cmd_name, "query-", &query_cmd)) { + cmd = qmp_find_cmd(cmd_name); + if (!cmd && strstart(cmd_name, "query-", &query_cmd)) { cmd = qmp_find_query_cmd(query_cmd); - } else { - cmd = qmp_find_cmd(cmd_name); } - if (!cmd) { qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name); goto err_out; -- cgit v1.2.1