From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCfBM-0008NU-HD for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCfBH-0008Jt-Kw for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:44 -0500 Received: from [199.232.76.173] (port=42674 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCfBH-0008JQ-0W for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42692) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCfBG-0001Zo-Hk for qemu-devel@nongnu.org; Mon, 23 Nov 2009 15:06:38 -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 nANK6b4A016129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Nov 2009 15:06:37 -0500 Received: from localhost (vpn-9-248.rdu.redhat.com [10.11.9.248]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nANK6aPH029068 for ; Mon, 23 Nov 2009 15:06:36 -0500 From: Luiz Capitulino Date: Mon, 23 Nov 2009 18:06:11 -0200 Message-Id: <1259006783-945-6-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 05/17] monitor: Fix do_info_balloon() output List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org New monitor commands should always return values in bytes. Signed-off-by: Luiz Capitulino --- monitor.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 3286ba2..e3368c8 100644 --- a/monitor.c +++ b/monitor.c @@ -1702,12 +1702,18 @@ static void do_balloon(Monitor *mon, const QDict *qdict, QObject **ret_data) static void monitor_print_balloon(Monitor *mon, const QObject *data) { - monitor_printf(mon, "balloon: actual=%d\n", - (int)qint_get_int(qobject_to_qint(data))); + monitor_printf(mon, "balloon: actual=%" PRId64 "\n", + qint_get_int(qobject_to_qint(data)) >> 20); } /** * do_info_balloon(): Balloon information + * + * Return a QInt with current ballooning value. + * + * Example: + * + * 1073741824 */ static void do_info_balloon(Monitor *mon, QObject **ret_data) { @@ -1720,7 +1726,7 @@ static void do_info_balloon(Monitor *mon, QObject **ret_data) else if (actual == 0) monitor_printf(mon, "Ballooning not activated in VM\n"); else - *ret_data = QOBJECT(qint_from_int((int)(actual >> 20))); + *ret_data = QOBJECT(qint_from_int(actual)); } static qemu_acl *find_acl(Monitor *mon, const char *name) -- 1.6.5.3.148.g785c5