提交 6fe15e35 编写于 作者: D Daniel P. Berrange

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
上级 294adef3
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册