mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemuProcessUpdateAndVerifyCPU: Refactor cleanup
Use automatic memory clearing and remove the 'ret' variable. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3ac3b3e8fb
commit
476e864186
@ -4335,25 +4335,19 @@ qemuProcessUpdateAndVerifyCPU(virQEMUDriver *driver,
|
||||
virDomainObj *vm,
|
||||
qemuDomainAsyncJob asyncJob)
|
||||
{
|
||||
virCPUData *cpu = NULL;
|
||||
virCPUData *disabled = NULL;
|
||||
int ret = -1;
|
||||
g_autoptr(virCPUData) cpu = NULL;
|
||||
g_autoptr(virCPUData) disabled = NULL;
|
||||
|
||||
if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (qemuProcessVerifyCPU(vm, cpu) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (qemuProcessUpdateLiveGuestCPU(vm, cpu, disabled) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCPUDataFree(cpu);
|
||||
virCPUDataFree(disabled);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user