提交 1a136774 编写于 作者: P Peter Krempa

conf: audit: Audit physical memory size rather than balloon request

Since the balloon driver does not guarantee that it returns memory to
the host, using the value in the audit message is not a good idea.

This patch removes auditing from updating the balloon size and reports
the total physical size at startup.
上级 ffbafd4e
......@@ -883,7 +883,8 @@ virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success)
if (vm->def->tpm)
virDomainAuditTPM(vm, vm->def->tpm, "start", true);
virDomainAuditMemory(vm, 0, vm->def->mem.cur_balloon, "start", true);
virDomainAuditMemory(vm, 0, virDomainDefGetMemoryActual(vm->def),
"start", true);
virDomainAuditVcpu(vm, 0, vm->def->vcpus, "start", true);
if (vm->def->iothreads)
virDomainAuditIOThread(vm, 0, vm->def->iothreads, "start", true);
......
......@@ -2386,11 +2386,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
priv = vm->privateData;
qemuDomainObjEnterMonitor(driver, vm);
r = qemuMonitorSetBalloon(priv->mon, newmem);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto endjob;
virDomainAuditMemory(vm, def->mem.cur_balloon, newmem, "update",
r == 1);
if (r < 0)
if (qemuDomainObjExitMonitor(driver, vm) < 0 || r < 0)
goto endjob;
/* Lack of balloon support is a fatal error */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册