From patchwork Mon Nov 23 20:06:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 39084 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 2AD2FB7B64 for ; Tue, 24 Nov 2009 07:15:02 +1100 (EST) Received: from localhost ([127.0.0.1]:46079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCfJL-0002Lo-UB for incoming@patchwork.ozlabs.org; Mon, 23 Nov 2009 15:14:59 -0500 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 To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 05/17] monitor: Fix do_info_balloon() output 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 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)