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 From: Luiz Capitulino 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> Subject: [Qemu-devel] [PATCH 13/25] Monitor: Convert do_info_kvm_print() into do_info_kvm() 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 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", -- 1.7.3.3.398.g0b0cd