From patchwork Mon Dec 6 18:24:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 74451 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 1ACA6B708B for ; Tue, 7 Dec 2010 05:47:26 +1100 (EST) Received: from localhost ([127.0.0.1]:44207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPg5r-0005zZ-89 for incoming@patchwork.ozlabs.org; Mon, 06 Dec 2010 13:47:23 -0500 Received: from [140.186.70.92] (port=36199 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPfk8-0003MY-Nj for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:24:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPfk7-0004H4-8p for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:24:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPfk7-0004Gk-0y for qemu-devel@nongnu.org; Mon, 06 Dec 2010 13:24:55 -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 oB6IOsCO014970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Dec 2010 13:24:54 -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 oB6IOr17030153; Mon, 6 Dec 2010 13:24:53 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 6 Dec 2010 16:24:08 -0200 Message-Id: <1291659852-23028-22-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 21/25] Monitor: Convert do_info_uuid_print() into do_info_uuid() 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_uuid() 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 e9b07f3..3b6137e 100644 --- a/monitor.c +++ b/monitor.c @@ -818,9 +818,13 @@ static void qmp_query_uuid(Monitor *mon, QObject **ret_data) *ret_data = qobject_from_jsonf("{ 'UUID': %s }", uuid); } -static void do_info_uuid_print(Monitor *mon, const QObject *data) +static void do_info_uuid(Monitor *mon) { + QObject *data; + + qmp_query_uuid(NULL, &data); monitor_printf(mon, "%s\n", qdict_get_str(qobject_to_qdict(data), "UUID")); + qobject_decref(data); } /* get the current CPU defined by the user */ @@ -2586,8 +2590,7 @@ static const mon_cmd_t info_cmds[] = { .args_type = "", .params = "", .help = "show the current VM UUID", - .user_print = do_info_uuid_print, - .mhandler.info_new = qmp_query_uuid, + .mhandler.info = do_info_uuid, }, #if defined(TARGET_PPC) {