Received: from [140.186.70.92] (port=36344 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPfkF-0003Sf-EI for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:25:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPfkE-0004LS-7q for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:25:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPfkD-0004KW-Sc for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:25:02 -0500 From: Luiz Capitulino Date: Mon, 6 Dec 2010 16:24:12 -0200 Message-Id: <1291659852-23028-26-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1291659852-23028-1-git-send-email-lcapitulino@redhat.com> References: <1291659852-23028-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 25/25] Monitor: do_info(): Drop unused code List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, armbru@redhat.com Last commits moved QMP calling code to the info handlers themselves, now do_info() does nothing with QMP anymore, just drop all QMP handling code from it. Signed-off-by: Luiz Capitulino --- monitor.c | 42 ++++++------------------------------------ 1 files changed, 6 insertions(+), 36 deletions(-) diff --git a/monitor.c b/monitor.c index d07608e..8bfd755 100644 --- a/monitor.c +++ b/monitor.c @@ -661,28 +661,14 @@ static void user_async_cmd_handler(Monitor *mon, const mon_cmd_t *cmd, } } -static void user_async_info_handler(Monitor *mon, const mon_cmd_t *cmd) -{ - int ret; - - MonitorCompletionData *cb_data = qemu_malloc(sizeof(*cb_data)); - cb_data->mon = mon; - cb_data->user_print = cmd->user_print; - monitor_suspend(mon); - ret = cmd->mhandler.info_async(mon, user_monitor_complete, cb_data); - if (ret < 0) { - monitor_resume(mon); - qemu_free(cb_data); - } -} - static void do_info(Monitor *mon, const QDict *qdict) { const mon_cmd_t *cmd; const char *item = qdict_get_try_str(qdict, "item"); if (!item) { - goto help; + help_cmd(mon, "info"); + return; } for (cmd = info_cmds; cmd->name != NULL; cmd++) { @@ -690,28 +676,12 @@ static void do_info(Monitor *mon, const QDict *qdict) break; } - if (cmd->name == NULL) { - goto help; - } - - if (handler_is_async(cmd)) { - user_async_info_handler(mon, cmd); - } else if (handler_is_qobject(cmd)) { - QObject *info_data = NULL; - - cmd->mhandler.info_new(mon, &info_data); - if (info_data) { - cmd->user_print(mon, info_data); - qobject_decref(info_data); - } - } else { - cmd->mhandler.info(mon); + if (!cmd->name) { + help_cmd(mon, "info"); + return; } - return; - -help: - help_cmd(mon, "info"); + cmd->mhandler.info(mon); } static void do_info_balloon(Monitor *mon) -- 1.7.3.3.398.g0b0cd