[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/17] monitor: Fix do_info_balloon() output
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 05/17] monitor: Fix do_info_balloon() output |
Date: |
Mon, 23 Nov 2009 18:06:11 -0200 |
New monitor commands should always return values in bytes.
Signed-off-by: Luiz Capitulino <address@hidden>
---
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
- [Qemu-devel] [PATCH v1 00/17]: info handlers conversions to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 01/17] Introduce qemu-objects.h header file, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 02/17] Makefile: move QObject objs to their own entry, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 03/17] QDict: Introduce qdict_get_qbool(), Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 04/17] QDict: Introduce qdict_get_qlist(), Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 05/17] monitor: Fix do_info_balloon() output,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 06/17] monitor: Convert do_info_status() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 07/17] monitor: Convert do_info_kvm() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 08/17] monitor: Convert do_info_name() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 09/17] monitor: Convert do_info_hpet() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 10/17] monitor: Convert do_info_uuid() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 11/17] monitor: Convert do_info_mice() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 12/17] migration: Convert do_info_migrate() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 13/17] block: Convert bdrv_info() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 15/17] char: Convert qemu_chr_info() to QObject, Luiz Capitulino, 2009/11/23
- [Qemu-devel] [PATCH 14/17] block: Convert bdrv_info_stats() to QObject, Luiz Capitulino, 2009/11/23