From patchwork Mon Dec 6 18:24:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 74438 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 D7CB5B70EC for ; Tue, 7 Dec 2010 05:36:17 +1100 (EST) Received: from localhost ([127.0.0.1]:51803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPfv4-0008UK-Pt for incoming@patchwork.ozlabs.org; Mon, 06 Dec 2010 13:36:14 -0500 Received: from [140.186.70.92] (port=35949 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPfju-0003Bn-7U for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:24:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPfjt-0004BP-3z for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:24:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPfjs-0004BG-SB for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:24:41 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB6IOe0D005911 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Dec 2010 13:24:40 -0500 Received: from localhost ([10.3.113.17]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB6IOdBM002868; Mon, 6 Dec 2010 13:24:39 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 6 Dec 2010 16:24:00 -0200 Message-Id: <1291659852-23028-14-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.68 on 10.5.11.24 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 13/25] Monitor: Convert do_info_kvm_print() into do_info_kvm() 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 The new handler directly calls qmp_query_kvm() to gather data and then prints it. This change allows us to drop the user_print callback. Signed-off-by: Luiz Capitulino --- monitor.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index e8f0562..4286375 100644 --- a/monitor.c +++ b/monitor.c @@ -2004,10 +2004,12 @@ static void qmp_query_kvm(Monitor *mon, QObject **ret_data) #endif } -static void do_info_kvm_print(Monitor *mon, const QObject *data) +static void do_info_kvm(Monitor *mon) { + QObject *data; QDict *qdict; + qmp_query_kvm(NULL, &data); qdict = qobject_to_qdict(data); monitor_printf(mon, "kvm support: "); @@ -2017,6 +2019,8 @@ static void do_info_kvm_print(Monitor *mon, const QObject *data) } else { monitor_printf(mon, "not compiled\n"); } + + qobject_decref(data); } static void do_info_numa(Monitor *mon) @@ -2490,8 +2494,7 @@ static const mon_cmd_t info_cmds[] = { .args_type = "", .params = "", .help = "show KVM information", - .user_print = do_info_kvm_print, - .mhandler.info_new = qmp_query_kvm, + .mhandler.info = do_info_kvm, }, { .name = "numa",