From patchwork Thu Oct 27 19:02:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 122227 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 1D9151007D8 for ; Fri, 28 Oct 2011 06:23:33 +1100 (EST) Received: from localhost ([::1]:47772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJVXx-0005DK-BO for incoming@patchwork.ozlabs.org; Thu, 27 Oct 2011 15:23:25 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJVEg-0005M4-3R for qemu-devel@nongnu.org; Thu, 27 Oct 2011 15:03:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJVEd-0002Cy-EC for qemu-devel@nongnu.org; Thu, 27 Oct 2011 15:03:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJVEc-0002Bf-Sf for qemu-devel@nongnu.org; Thu, 27 Oct 2011 15:03:27 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9RJ2thN015428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Oct 2011 15:02:56 -0400 Received: from localhost (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9RJ2sIl011400; Thu, 27 Oct 2011 15:02:55 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Thu, 27 Oct 2011 17:02:15 -0200 Message-Id: <1319742136-8691-19-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1319742136-8691-1-git-send-email-lcapitulino@redhat.com> References: <1319742136-8691-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org 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: