From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCfBU-0008S6-Mk for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCfBP-0008PD-SA for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:52 -0500 Received: from [199.232.76.173] (port=42682 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCfBP-0008P8-K4 for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30908) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCfBO-0001b2-T2 for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:47 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nANK6kqu002772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Nov 2009 15:06:46 -0500 Received: from localhost (vpn-9-248.rdu.redhat.com [10.11.9.248]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nANK6iL1005869 for ; Mon, 23 Nov 2009 15:06:45 -0500 From: Luiz Capitulino Date: Mon, 23 Nov 2009 18:06:15 -0200 Message-Id: <1259006783-945-10-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1259006783-945-1-git-send-email-lcapitulino@redhat.com> References: <1259006783-945-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 09/17] monitor: Convert do_info_hpet() to QObject List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Return a QString with HPET information. Signed-off-by: Luiz Capitulino --- monitor.c | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 1540254..ab21db4 100644 --- a/monitor.c +++ b/monitor.c @@ -361,10 +361,27 @@ static void do_info_name(Monitor *mon, QObject **ret_data) } #if defined(TARGET_I386) -static void do_info_hpet(Monitor *mon) +static void do_info_hpet_print(Monitor *mon, const QObject *data) { monitor_printf(mon, "HPET is %s by QEMU\n", - (no_hpet) ? "disabled" : "enabled"); + qstring_get_str(qobject_to_qstring(data))); +} + +/** + * do_info_hpet(): Show HPET state + * + * Return a QString with HPET information, which can be: + * + * - "enabled" + * - "disabled" + */ +static void do_info_hpet(Monitor *mon, QObject **ret_data) +{ + if (no_hpet) { + *ret_data = QOBJECT(qstring_from_str("disabled")); + } else { + *ret_data = QOBJECT(qstring_from_str("enabled")); + } } #endif @@ -2102,7 +2119,8 @@ static const mon_cmd_t info_cmds[] = { .args_type = "", .params = "", .help = "show state of HPET", - .mhandler.info = do_info_hpet, + .user_print = do_info_hpet_print, + .mhandler.info_new = do_info_hpet, }, #endif { -- 1.6.5.3.148.g785c5