mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu_domain.c: modernize qemuMonitorGetCpuHalted()
Use g_autoptr() and remove the 'cleanup' label. Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
8a778ebfe1
commit
66ee13809c
@ -9217,9 +9217,8 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver,
|
|||||||
virDomainVcpuDefPtr vcpu;
|
virDomainVcpuDefPtr vcpu;
|
||||||
qemuDomainVcpuPrivatePtr vcpupriv;
|
qemuDomainVcpuPrivatePtr vcpupriv;
|
||||||
size_t maxvcpus = virDomainDefGetVcpusMax(vm->def);
|
size_t maxvcpus = virDomainDefGetVcpusMax(vm->def);
|
||||||
virBitmapPtr haltedmap = NULL;
|
g_autoptr(virBitmap) haltedmap = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
int ret = -1;
|
|
||||||
bool fast;
|
bool fast;
|
||||||
|
|
||||||
/* Not supported currently for TCG, see qemuDomainRefreshVcpuInfo */
|
/* Not supported currently for TCG, see qemuDomainRefreshVcpuInfo */
|
||||||
@ -9244,7 +9243,7 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver,
|
|||||||
haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus,
|
haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus,
|
||||||
fast);
|
fast);
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !haltedmap)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !haltedmap)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
for (i = 0; i < maxvcpus; i++) {
|
for (i = 0; i < maxvcpus; i++) {
|
||||||
vcpu = virDomainDefGetVcpu(vm->def, i);
|
vcpu = virDomainDefGetVcpu(vm->def, i);
|
||||||
@ -9253,11 +9252,7 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver,
|
|||||||
vcpupriv->qemu_id));
|
vcpupriv->qemu_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virBitmapFree(haltedmap);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Loading…
Reference in New Issue
Block a user