From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49458 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1kDz-00066J-Ea for qemu-devel@nongnu.org; Fri, 01 Oct 2010 14:21:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P1kDP-0003Q7-MN for qemu-devel@nongnu.org; Fri, 01 Oct 2010 14:20:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P1kDP-0003Pl-BQ for qemu-devel@nongnu.org; Fri, 01 Oct 2010 14:20:15 -0400 From: Luiz Capitulino Date: Fri, 1 Oct 2010 15:19:24 -0300 Message-Id: <1285957167-1228-21-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1285957167-1228-1-git-send-email-lcapitulino@redhat.com> References: <1285957167-1228-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 20/23] Monitor: Directly call QObject handlers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com Cc: qemu-devel@nongnu.org This avoids handle_user_command() calling monitor_call_handler(), which is currently shared with QMP. Signed-off-by: Luiz Capitulino --- monitor.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/monitor.c b/monitor.c index 7959504..03f3c18 100644 --- a/monitor.c +++ b/monitor.c @@ -3917,7 +3917,15 @@ static void handle_user_command(Monitor *mon, const char *cmdline) if (handler_is_async(cmd)) { user_async_cmd_handler(mon, cmd, qdict); } else if (handler_is_qobject(cmd)) { - monitor_call_handler(mon, cmd, qdict); + QObject *data = NULL; + + /* XXX: ignores the error code */ + cmd->mhandler.cmd_new(mon, qdict, &data); + assert(!monitor_has_error(mon)); + if (data) { + cmd->user_print(mon, data); + qobject_decref(data); + } } else { cmd->mhandler.cmd(mon, qdict); } -- 1.7.3.1.50.g1e633