[PATCH v2 1/5] vz: use state variable sdkdom in prlsdkApplyConfig

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

 



sdk domain handle is unique per connection so there is
no sense to query it again if we have it in vzDomObjPtr.
Side effect of prlsdkSdkDomainLookupByUUID is refreshing
domain config is of no use too as PrlVm_BeginEdit do it too.
---
 src/vz/vz_sdk.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 5e36a8b..6b5adbf 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3906,28 +3906,22 @@ prlsdkApplyConfig(vzDriverPtr driver,
                   virDomainObjPtr dom,
                   virDomainDefPtr new)
 {
-    PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
+    vzDomObjPtr privdom = dom->privateData;
     PRL_HANDLE job = PRL_INVALID_HANDLE;
     int ret;
 
-    sdkdom = prlsdkSdkDomainLookupByUUID(driver, dom->def->uuid);
-    if (sdkdom == PRL_INVALID_HANDLE)
-        return -1;
-
-    job = PrlVm_BeginEdit(sdkdom);
+    job = PrlVm_BeginEdit(privdom->sdkdom);
     if (PRL_FAILED(waitJob(job)))
         return -1;
 
-    ret = prlsdkDoApplyConfig(driver, sdkdom, new, dom->def);
+    ret = prlsdkDoApplyConfig(driver, privdom->sdkdom, new, dom->def);
 
     if (ret == 0) {
-        job = PrlVm_CommitEx(sdkdom, PVCF_DETACH_HDD_BUNDLE);
+        job = PrlVm_CommitEx(privdom->sdkdom, PVCF_DETACH_HDD_BUNDLE);
         if (PRL_FAILED(waitJob(job)))
             ret = -1;
     }
 
-    PrlHandle_Free(sdkdom);
-
     return ret;
 }
 
-- 
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]