mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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:
parent
3f2fa8f303
commit
3b0856c4ba
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user