From patchwork Mon Dec 6 18:24:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 74455 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7C839B70CD for ; Tue, 7 Dec 2010 05:55:29 +1100 (EST) Received: from localhost ([127.0.0.1]:56863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPgDd-0002JY-UG for incoming@patchwork.ozlabs.org; Mon, 06 Dec 2010 13:55:26 -0500 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 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB6IP1At005957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Dec 2010 13:25:01 -0500 Received: from localhost ([10.3.113.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB6IP05e030188; Mon, 6 Dec 2010 13:25:00 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com, armbru@redhat.com Subject: [Qemu-devel] [PATCH 25/25] Monitor: do_info(): Drop unused code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)