From patchwork Mon Oct 24 13:27:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 121351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 67ABDB6F99 for ; Tue, 25 Oct 2011 00:29:35 +1100 (EST) Received: from localhost ([::1]:41148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIKan-0004E3-Rn for incoming@patchwork.ozlabs.org; Mon, 24 Oct 2011 09:29:29 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIKZF-0001Ml-3X for qemu-devel@nongnu.org; Mon, 24 Oct 2011 09:27:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIKZC-0003fB-MH for qemu-devel@nongnu.org; Mon, 24 Oct 2011 09:27:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIKZC-0003ey-3S for qemu-devel@nongnu.org; Mon, 24 Oct 2011 09:27:50 -0400 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.14.4/8.14.4) with ESMTP id p9ODRmRU026829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Oct 2011 09:27:48 -0400 Received: from localhost (ovpn-113-89.phx2.redhat.com [10.3.113.89]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9ODRllt015689; Mon, 24 Oct 2011 09:27:47 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 24 Oct 2011 11:27:11 -0200 Message-Id: <1319462832-12199-19-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1319462832-12199-1-git-send-email-lcapitulino@redhat.com> References: <1319462832-12199-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: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, armbru@redhat.com, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, quintela@redhat.com Subject: [Qemu-devel] [PATCH 18/19] Monitor: do_info(): Drop QMP command handling code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Previous commits converted all existing QMP commands to the QAPI, now each info command does its own QMP call. Let's then drop all QMP command handling code from do_info(). Signed-off-by: Luiz Capitulino --- monitor.c | 32 +------------------------------- 1 files changed, 1 insertions(+), 31 deletions(-) diff --git a/monitor.c b/monitor.c index 1e09b91..e3c7d0d 100644 --- a/monitor.c +++ b/monitor.c @@ -123,8 +123,6 @@ typedef struct mon_cmd_t { void (*user_print)(Monitor *mon, const QObject *data); union { void (*info)(Monitor *mon); - void (*info_new)(Monitor *mon, QObject **ret_data); - int (*info_async)(Monitor *mon, MonitorCompletion *cb, void *opaque); void (*cmd)(Monitor *mon, const QDict *qdict); int (*cmd_new)(Monitor *mon, const QDict *params, QObject **ret_data); int (*cmd_async)(Monitor *mon, const QDict *params, @@ -679,21 +677,6 @@ 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 = g_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); - g_free(cb_data); - } -} - static void do_info(Monitor *mon, const QDict *qdict) { const mon_cmd_t *cmd; @@ -712,20 +695,7 @@ static void do_info(Monitor *mon, const QDict *qdict) 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); - } - + cmd->mhandler.info(mon); return; help: