qemu: Clean up usage of qemuDomainUpdateCurrentMemorySize

Remove the uneeded attribute and return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2019-02-07 10:46:20 +01:00
parent 3f2fa8f303
commit 3b0856c4ba
3 changed files with 7 additions and 18 deletions

View File

@ -10264,25 +10264,18 @@ qemuDomainMachineHasBuiltinIDE(const char *machine)
* *
* In case when the balloon is not present for the domain, the function * In case when the balloon is not present for the domain, the function
* recalculates the maximum size to reflect possible changes. * recalculates the maximum size to reflect possible changes.
*
* Returns 0 on success and updates vm->def->mem.cur_balloon if necessary.
*/ */
int void
qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm)
virDomainObjPtr vm)
{ {
/* inactive domain doesn't need size update */ /* inactive domain doesn't need size update */
if (!virDomainObjIsActive(vm)) if (!virDomainObjIsActive(vm))
return 0; return;
/* if no balloning is available, the current size equals to the current /* if no balloning is available, the current size equals to the current
* full memory size */ * full memory size */
if (!virDomainDefHasMemballoon(vm->def)) { if (!virDomainDefHasMemballoon(vm->def))
vm->def->mem.cur_balloon = virDomainDefGetMemoryTotal(vm->def); vm->def->mem.cur_balloon = virDomainDefGetMemoryTotal(vm->def);
return 0;
}
return 0;
} }

View File

@ -851,8 +851,7 @@ bool qemuDomainMachineIsPSeries(const char *machine,
const virArch arch); const virArch arch);
bool qemuDomainMachineHasBuiltinIDE(const char *machine); bool qemuDomainMachineHasBuiltinIDE(const char *machine);
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, void qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm);
virDomainObjPtr vm);
unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDefPtr def); unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDefPtr def);
int qemuDomainAdjustMaxMemLock(virDomainObjPtr vm); int qemuDomainAdjustMaxMemLock(virDomainObjPtr vm);

View File

@ -2585,7 +2585,6 @@ qemuDomainGetInfo(virDomainPtr dom,
virDomainInfoPtr info) virDomainInfoPtr info)
{ {
unsigned long long maxmem; unsigned long long maxmem;
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
@ -2595,8 +2594,7 @@ qemuDomainGetInfo(virDomainPtr dom,
if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0) if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0)
goto cleanup; goto cleanup;
if (qemuDomainUpdateCurrentMemorySize(driver, vm) < 0) qemuDomainUpdateCurrentMemorySize(vm);
goto cleanup;
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
@ -7352,8 +7350,7 @@ static char
if (virDomainGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0) if (virDomainGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0)
goto cleanup; goto cleanup;
if (qemuDomainUpdateCurrentMemorySize(driver, vm) < 0) qemuDomainUpdateCurrentMemorySize(vm);
goto cleanup;
if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) if ((flags & VIR_DOMAIN_XML_MIGRATABLE))
flags |= QEMU_DOMAIN_FORMAT_LIVE_FLAGS; flags |= QEMU_DOMAIN_FORMAT_LIVE_FLAGS;