Avoid leaving the domain locked on a failed ACL check. Introduced in
commit abf75aea247e (Add ACL checks into the QEMU driver).
---
src/qemu/qemu_driver.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ed8e140..8cec372 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11393,51 +11393,53 @@ static int
qemuDomainMigratePerform(virDomainPtr dom,
const char *cookie,
int cookielen,
const char *uri,
unsigned long flags,
const char *dname,
unsigned long resource)
{
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
const char *dconnuri = NULL;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
if (virLockManagerPluginUsesState(driver->lockManager)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot use migrate v2 protocol with lock manager
%s"),
virLockManagerPluginGetName(driver->lockManager));
goto cleanup;
}
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;
uri = NULL;
}
/* Do not output cookies in v2 protocol, since the cookie
* length was not sufficiently large, causing failures
* migrating between old & new libvirtd.
*
* Consume any cookie we were able to decode though
*/
ret = qemuMigrationPerform(driver, dom->conn, vm,
NULL, dconnuri, uri, NULL, NULL,
cookie, cookielen,
NULL, NULL, /* No output cookies in v2 */
flags, dname, resource, false);
cleanup:
return ret;
}
/* Finish is the third and final step, and it runs on the destination host. */
--
2.1.0
Show replies by date
On 12/08/2014 07:31 PM, Peter Krempa wrote:
Avoid leaving the domain locked on a failed ACL check. Introduced in
commit abf75aea247e (Add ACL checks into the QEMU driver).
---
src/qemu/qemu_driver.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
ACK
Jan
On 12/09/14 08:21, Ján Tomko wrote:
On 12/08/2014 07:31 PM, Peter Krempa wrote:
> Avoid leaving the domain locked on a failed ACL check. Introduced in
> commit abf75aea247e (Add ACL checks into the QEMU driver).
> ---
> src/qemu/qemu_driver.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
ACK
I squashed together the second fix that I noticed after sending the
first one and pushed the result.
Thanks.
Peter