From: Daniel P. Berrange Date: Tue, 16 Feb 2010 16:31:19 +0000 (+0000) Subject: Update QEMU JSON balloon command handling X-Git-Tag: v0.7.7~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fe15e357d9c091f5779d27e7c90deb9ef8a6d0f;p=thirdparty%2Flibvirt.git 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 --- 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)