monitor: do_balloon(): Use 'M' argument type
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 18 Dec 2009 15:25:05 +0000 (13:25 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Sat, 19 Dec 2009 14:26:03 +0000 (08:26 -0600)
This makes do_balloon() accept megabyte values from the user
Monitor while accepting byte values for QMP.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c
qemu-monitor.hx

index 53a4674d9de894045371262a274620d3d2a7eae1..c0dc48ea004fae291895ff22d5d46568e90e193a 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -2083,8 +2083,7 @@ static void do_balloon(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     if (balloon_get_value()) {
         /* ballooning is active */
-        ram_addr_t value = qdict_get_int(qdict, "value");
-        qemu_balloon(value << 20);
+        qemu_balloon(qdict_get_int(qdict, "value"));
     }
 }
 
index 338e30e7d0c8000eb0b305116f97f0348e57f2a5..aac0f3e510fe527df1805aa290fcafa7455774fb 100644 (file)
@@ -887,7 +887,7 @@ ETEXI
 
     {
         .name       = "balloon",
-        .args_type  = "value:i",
+        .args_type  = "value:M",
         .params     = "target",
         .help       = "request VM to change it's memory allocation (in MB)",
         .user_print = monitor_user_noop,