提交 5290ca53 编写于 作者: J John Ferlan

lxc: Fix object locking after virDomainObjListRemove

The virDomainObjListRemove will return an unlocked
@vm after calling with a reffed object, thus prior
to calling virDomainObjEndAPI we should relock.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 abd1e54f
......@@ -493,6 +493,7 @@ lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
if (virDomainSaveConfig(cfg->configDir, driver->caps,
vm->newDef ? vm->newDef : vm->def) < 0) {
virDomainObjListRemove(driver->domains, vm);
virObjectLock(vm);
goto cleanup;
}
......@@ -557,6 +558,7 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
vm->persistent = 0;
} else {
virDomainObjListRemove(driver->domains, vm);
virObjectLock(vm);
}
ret = 0;
......@@ -1529,8 +1531,10 @@ lxcDomainDestroyFlags(virDomainPtr dom,
endjob:
virLXCDomainObjEndJob(driver, vm);
if (!vm->persistent)
if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
virObjectLock(vm);
}
cleanup:
virDomainObjEndAPI(&vm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册