From 6fe15e357d9c091f5779d27e7c90deb9ef8a6d0f Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 16 Feb 2010 16:31:19 +0000 Subject: [PATCH] Update QEMU JSON balloon command handling The QEMU JSON monitor changed balloon commands to return/accept bytes instead of kilobytes. Update libvirt to cope with this * src/qemu/qemu_monitor_json.c: Expect/use bytes for ballooning --- src/qemu/qemu_monitor_json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 49e0370344..7b45594c5e 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -723,14 +723,14 @@ int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon, goto cleanup; } - if (virJSONValueObjectGetNumberUlong(data, "balloon", &mem) < 0) { + if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("info balloon reply was missing balloon data")); ret = -1; goto cleanup; } - *currmem = mem; + *currmem = (mem/1024); ret = 1; } } @@ -885,7 +885,7 @@ int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon, { int ret; virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon", - "U:value", (unsigned long long)newmem, + "U:value", ((unsigned long long)newmem)*1024, NULL); virJSONValuePtr reply = NULL; if (!cmd) -- 2.47.2