[PATCH 06/10] vz: simplify refcount on sdkdom in prlsdkLoadDomain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 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 b7627e7..67c68df 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1642,17 +1642,16 @@ prlsdkLoadDomain(vzDriverPtr driver, virDomainObjPtr dom)
 
     prlsdkConvertDomainState(domainState, envId, dom);
 
-    if (!pdom->sdkdom) {
-        PrlHandle_AddRef(sdkdom);
+    if (pdom->sdkdom == PRL_INVALID_HANDLE)
         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);
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]