mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemu: Fix coverity issues after refcount refactoring
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
3865941be1
commit
31354b5b32
@ -1516,7 +1516,8 @@ static virDomainPtr qemuDomainLookupByName(virConnectPtr conn,
|
||||
if (dom) dom->id = vm->def->id;
|
||||
|
||||
cleanup:
|
||||
virObjectUnlock(vm);
|
||||
if (vm)
|
||||
virObjectUnlock(vm);
|
||||
return dom;
|
||||
}
|
||||
|
||||
|
@ -3101,7 +3101,9 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
||||
VIR_FREE(xmlout);
|
||||
VIR_FORCE_CLOSE(dataFD[0]);
|
||||
VIR_FORCE_CLOSE(dataFD[1]);
|
||||
if (ret < 0) {
|
||||
if (ret < 0 && priv) {
|
||||
/* priv is set right after vm is added to the list of domains
|
||||
* and there is no 'goto cleanup;' in the middle of those */
|
||||
virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
|
||||
priv->nbdPort = 0;
|
||||
qemuDomainRemoveInactive(driver, vm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user