From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCfBS-0008Qh-Bo for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCfBN-0008Nx-Hr for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:49 -0500 Received: from [199.232.76.173] (port=42678 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCfBN-0008Nj-9U for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59019) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCfBM-0001aU-Hg for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:44 -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 nANK6h5L024617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Nov 2009 15:06:43 -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 nANK6gvR005865 for ; Mon, 23 Nov 2009 15:06:43 -0500 From: Luiz Capitulino Date: Mon, 23 Nov 2009 18:06:14 -0200 Message-Id: <1259006783-945-9-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 08/17] monitor: Convert do_info_name() 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 the current VM name. Signed-off-by: Luiz Capitulino --- monitor.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index c2e82c8..1540254 100644 --- a/monitor.c +++ b/monitor.c @@ -349,10 +349,15 @@ static void do_info_version(Monitor *mon, QObject **ret_data) *ret_data = QOBJECT(qstring_from_str(QEMU_VERSION QEMU_PKGVERSION)); } -static void do_info_name(Monitor *mon) +/** + * do_info_name(): Show VM name + * + * Return a QString with the current VM name. + */ +static void do_info_name(Monitor *mon, QObject **ret_data) { if (qemu_name) - monitor_printf(mon, "%s\n", qemu_name); + *ret_data = QOBJECT(qstring_from_str(qemu_name)); } #if defined(TARGET_I386) @@ -2191,7 +2196,8 @@ static const mon_cmd_t info_cmds[] = { .args_type = "", .params = "", .help = "show the current VM name", - .mhandler.info = do_info_name, + .user_print = monitor_print_qobject, + .mhandler.info_new = do_info_name, }, { .name = "uuid", -- 1.6.5.3.148.g785c5