提交 3b0856c4 编写于 作者: P Peter Krempa

qemu: Clean up usage of qemuDomainUpdateCurrentMemorySize

Remove the uneeded attribute and return value.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 3f2fa8f3
......@@ -10264,25 +10264,18 @@ qemuDomainMachineHasBuiltinIDE(const char *machine)
*
* In case when the balloon is not present for the domain, the function
* recalculates the maximum size to reflect possible changes.
*
* Returns 0 on success and updates vm->def->mem.cur_balloon if necessary.
*/
int
qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
void
qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm)
{
/* inactive domain doesn't need size update */
if (!virDomainObjIsActive(vm))
return 0;
return;
/* if no balloning is available, the current size equals to the current
* full memory size */
if (!virDomainDefHasMemballoon(vm->def)) {
if (!virDomainDefHasMemballoon(vm->def))
vm->def->mem.cur_balloon = virDomainDefGetMemoryTotal(vm->def);
return 0;
}
return 0;
}
......
......@@ -851,8 +851,7 @@ bool qemuDomainMachineIsPSeries(const char *machine,
const virArch arch);
bool qemuDomainMachineHasBuiltinIDE(const char *machine);
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
virDomainObjPtr vm);
void qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm);
unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDefPtr def);
int qemuDomainAdjustMaxMemLock(virDomainObjPtr vm);
......
......@@ -2585,7 +2585,6 @@ qemuDomainGetInfo(virDomainPtr dom,
virDomainInfoPtr info)
{
unsigned long long maxmem;
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
......@@ -2595,8 +2594,7 @@ qemuDomainGetInfo(virDomainPtr dom,
if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (qemuDomainUpdateCurrentMemorySize(driver, vm) < 0)
goto cleanup;
qemuDomainUpdateCurrentMemorySize(vm);
memset(info, 0, sizeof(*info));
......@@ -7352,8 +7350,7 @@ static char
if (virDomainGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0)
goto cleanup;
if (qemuDomainUpdateCurrentMemorySize(driver, vm) < 0)
goto cleanup;
qemuDomainUpdateCurrentMemorySize(vm);
if ((flags & VIR_DOMAIN_XML_MIGRATABLE))
flags |= QEMU_DOMAIN_FORMAT_LIVE_FLAGS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册