1
0

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
This commit is contained in:
Daniel P. Berrange 2010-02-16 16:31:19 +00:00
parent 294adef356
commit 6fe15e357d

View File

@ -723,14 +723,14 @@ int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon,
goto cleanup; goto cleanup;
} }
if (virJSONValueObjectGetNumberUlong(data, "balloon", &mem) < 0) { if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon data")); _("info balloon reply was missing balloon data"));
ret = -1; ret = -1;
goto cleanup; goto cleanup;
} }
*currmem = mem; *currmem = (mem/1024);
ret = 1; ret = 1;
} }
} }
@ -885,7 +885,7 @@ int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
{ {
int ret; int ret;
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon", virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon",
"U:value", (unsigned long long)newmem, "U:value", ((unsigned long long)newmem)*1024,
NULL); NULL);
virJSONValuePtr reply = NULL; virJSONValuePtr reply = NULL;
if (!cmd) if (!cmd)