there can be a race with vzDomainDefineXMLFlags
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
src/vz/vz_sdk.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index db14e78..dcc2703 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1257,6 +1257,7 @@ prlsdkNewDomainByHandle(vzDriverPtr driver, PRL_HANDLE sdkdom)
if (prlsdkGetDomainIds(sdkdom, &name, uuid) < 0)
goto cleanup;
+ virObjectLock(driver);
if (!(dom = vzNewDomain(driver, name, uuid)))
goto cleanup;
@@ -1267,6 +1268,7 @@ prlsdkNewDomainByHandle(vzDriverPtr driver, PRL_HANDLE sdkdom)
}
cleanup:
+ virObjectUnlock(driver);
VIR_FREE(name);
return dom;
}
--
2.4.3