qemu: migration: Unlock vm on failed ACL check in protocol v2 APIs

Avoid leaving the domain locked on a failed ACL check in
qemuDomainMigratePerform() and qemuDomainMigrateFinish2().

Introduced in commit abf75aea24 (Add ACL checks into the QEMU driver).
This commit is contained in:
Peter Krempa 2014-12-08 19:25:21 +01:00
parent 77a778d2e0
commit 2bdcd29c71
1 changed files with 6 additions and 2 deletions

View File

@ -11415,8 +11415,10 @@ qemuDomainMigratePerform(virDomainPtr dom,
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;
@ -11463,8 +11465,10 @@ qemuDomainMigrateFinish2(virConnectPtr dconn,
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