03.06.2016 10:11, Nikolay Shirokovskiy пишет:
Signed-off-by: Nikolay Shirokovskiy
<nshirokovskiy(a)virtuozzo.com>
---
src/vz/vz_sdk.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 7eb78ca..73bf748 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1615,17 +1615,16 @@ prlsdkLoadDomain(vzDriverPtr driver, virDomainObjPtr dom)
prlsdkConvertDomainState(domainState, envId, dom);
- if (!pdom->sdkdom) {
- PrlHandle_AddRef(sdkdom);
+ if (pdom->sdkdom == PRL_INVALID_HANDLE)
This change implies knowledge that PRL_INVALID_HANDLE is equal to 0
while it is not obvious and we don't explicitly set pdom->sdkdom to
PRL_INVALID_HANDLE
when we allocate vzDomObj.
Thus, this change doesn't seem to simply things, rather it complicates
at least my understanding,
and I think we could easily avoid it.
pdom->sdkdom = sdkdom;
- }
+ else
+ PrlHandle_Free(sdkdom);
if (autostart == PAO_VM_START_ON_LOAD)
dom->autostart = 1;
else
dom->autostart = 0;
- PrlHandle_Free(sdkdom);
return 0;
error:
PrlHandle_Free(sdkdom);