提交 b5e08e8c 编写于 作者: N Nikolay Shirokovskiy 提交者: Maxim Nestratov

vz: fix missed defined domain event

libvirt domain defined event is issued only on correspondent vz sdk
event. But in case event delivered before domain is added to
domain list we can mistakenly skip this event if prlsdkNewDomainByHandle
return NULL in case of domain is discovered in the list under
the driver lock. Let's return domain object in this case.
Now prlsdkNewDomainByHandle returns NULL only in case of
error which is more convinient.
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
上级 ac60d423
......@@ -1421,12 +1421,8 @@ prlsdkNewDomainByHandle(vzDriverPtr driver, PRL_HANDLE sdkdom)
goto cleanup;
/* we should make sure that there is no such a VM exists */
dom = virDomainObjListFindByUUID(driver->domains, uuid);
if (dom) {
virObjectUnlock(dom);
dom = NULL;
if ((dom = virDomainObjListFindByUUID(driver->domains, uuid)))
goto cleanup;
}
if (!(dom = vzNewDomain(driver, name, uuid)))
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册