Avoid leaving the domain locked on a failed ACL check in
qemuDomainMigratePerform() and qemuDomainMigrateFinish2().
Introduced in commit
abf75aea247e (Add ACL checks into the QEMU driver).
if (!(vm = qemuDomObjFromDomain(dom)))
goto cleanup;
- if (virDomainMigratePerformEnsureACL(dom->conn, vm->def) < 0)
+ if (virDomainMigratePerformEnsureACL(dom->conn, vm->def) < 0) {
+ virObjectUnlock(vm);
goto cleanup;
+ }
if (flags & VIR_MIGRATE_PEER2PEER) {
dconnuri = uri;
goto cleanup;
}
- if (virDomainMigrateFinish2EnsureACL(dconn, vm->def) < 0)
+ if (virDomainMigrateFinish2EnsureACL(dconn, vm->def) < 0) {
+ virObjectUnlock(vm);
goto cleanup;
+ }
/* Do not use cookies in v2 protocol, since the cookie
* length was not sufficiently large, causing failures