summary refs log tree commit diff stats
path: root/balloon.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-12 10:08:08 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-12 10:08:08 -0600
commit9bf4896e5d565785316d2c179be91fba11fbf3fb (patch)
tree4ac5f38e5f88949dbded2562db95ddb9253c28a2 /balloon.c
parent774d5c5b1604b8443a8e42048b370b6c95dbfc40 (diff)
parent3dc853832db7bf8ac3878e0666c639d3bc02b587 (diff)
downloadfocaccia-qemu-9bf4896e5d565785316d2c179be91fba11fbf3fb.tar.gz
focaccia-qemu-9bf4896e5d565785316d2c179be91fba11fbf3fb.zip
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Diffstat (limited to 'balloon.c')
-rw-r--r--balloon.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/balloon.c b/balloon.c
index e1cd5fac4c..0166744aa8 100644
--- a/balloon.c
+++ b/balloon.c
@@ -100,31 +100,19 @@ BalloonInfo *qmp_query_balloon(Error **errp)
     return info;
 }
 
-/**
- * do_balloon(): Request VM to change its memory allocation
- */
-int do_balloon(Monitor *mon, const QDict *params,
-	       MonitorCompletion cb, void *opaque)
+void qmp_balloon(int64_t value, Error **errp)
 {
-    int64_t target;
-    int ret;
-
     if (kvm_enabled() && !kvm_has_sync_mmu()) {
-        qerror_report(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon");
-        return -1;
+        error_set(errp, QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon");
+        return;
     }
 
-    target = qdict_get_int(params, "value");
-    if (target <= 0) {
+    if (value <= 0) {
         qerror_report(QERR_INVALID_PARAMETER_VALUE, "target", "a size");
-        return -1;
+        return;
     }
-    ret = qemu_balloon(target);
-    if (ret == 0) {
-        qerror_report(QERR_DEVICE_NOT_ACTIVE, "balloon");
-        return -1;
+    
+    if (qemu_balloon(value) == 0) {
+        error_set(errp, QERR_DEVICE_NOT_ACTIVE, "balloon");
     }
-
-    cb(opaque, NULL);
-    return 0;
 }