[PATCH 05/11] vz: pass vzConnPtr to prlsdkXxx functions instead of virConnectPtr

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

 



Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
 src/vz/vz_driver.c |  6 +++---
 src/vz/vz_sdk.c    | 25 +++++++++++--------------
 src/vz/vz_sdk.h    |  6 +++---
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index d3dcf3d..7de21d8 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -679,10 +679,10 @@ vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
         if (!newdom)
             goto cleanup;
         if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
-            if (prlsdkCreateVm(conn, def))
+            if (prlsdkCreateVm(privconn, def))
                 goto cleanup;
         } else if (def->os.type == VIR_DOMAIN_OSTYPE_EXE) {
-            if (prlsdkCreateCt(conn, def))
+            if (prlsdkCreateCt(privconn, def))
                 goto cleanup;
         } else {
             virReportError(VIR_ERR_INVALID_ARG,
@@ -717,7 +717,7 @@ vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
                 goto cleanup;
             }
         } else {
-            if (prlsdkApplyConfig(conn, olddom, def))
+            if (prlsdkApplyConfig(privconn, olddom, def))
                 goto cleanup;
 
             if (prlsdkUpdateDomain(privconn, olddom))
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 629906e..541060a 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3600,7 +3600,7 @@ prlsdkSetBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def)
 }
 
 static int
-prlsdkDoApplyConfig(virConnectPtr conn,
+prlsdkDoApplyConfig(vzConnPtr privconn,
                     PRL_HANDLE sdkdom,
                     virDomainDefPtr def,
                     virDomainDefPtr olddef)
@@ -3666,11 +3666,11 @@ prlsdkDoApplyConfig(virConnectPtr conn,
 
     if (olddef) {
         for (i = 0; i < olddef->nnets; i++)
-            prlsdkCleanupBridgedNet(conn->privateData, olddef->nets[i]);
+            prlsdkCleanupBridgedNet(privconn, olddef->nets[i]);
     }
 
     for (i = 0; i < def->nnets; i++) {
-        if (prlsdkAddNet(conn->privateData, sdkdom, def->nets[i], IS_CT(def)) < 0)
+        if (prlsdkAddNet(privconn, sdkdom, def->nets[i], IS_CT(def)) < 0)
             goto error;
     }
 
@@ -3691,7 +3691,7 @@ prlsdkDoApplyConfig(virConnectPtr conn,
     }
 
     for (i = 0; i < def->ndisks; i++) {
-        if (prlsdkAddDisk(conn->privateData, sdkdom, def->disks[i]) < 0)
+        if (prlsdkAddDisk(privconn, sdkdom, def->disks[i]) < 0)
             goto error;
     }
 
@@ -3709,17 +3709,16 @@ prlsdkDoApplyConfig(virConnectPtr conn,
     VIR_FREE(mask);
 
     for (i = 0; i < def->nnets; i++)
-        prlsdkCleanupBridgedNet(conn->privateData, def->nets[i]);
+        prlsdkCleanupBridgedNet(privconn, def->nets[i]);
 
     return -1;
 }
 
 int
-prlsdkApplyConfig(virConnectPtr conn,
+prlsdkApplyConfig(vzConnPtr privconn,
                   virDomainObjPtr dom,
                   virDomainDefPtr new)
 {
-    vzConnPtr privconn = conn->privateData;
     PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
     PRL_HANDLE job = PRL_INVALID_HANDLE;
     int ret;
@@ -3732,7 +3731,7 @@ prlsdkApplyConfig(virConnectPtr conn,
     if (PRL_FAILED(waitJob(job)))
         return -1;
 
-    ret = prlsdkDoApplyConfig(conn, sdkdom, new, dom->def);
+    ret = prlsdkDoApplyConfig(privconn, sdkdom, new, dom->def);
 
     if (ret == 0) {
         job = PrlVm_CommitEx(sdkdom, PVCF_DETACH_HDD_BUNDLE);
@@ -3746,9 +3745,8 @@ prlsdkApplyConfig(virConnectPtr conn,
 }
 
 int
-prlsdkCreateVm(virConnectPtr conn, virDomainDefPtr def)
+prlsdkCreateVm(vzConnPtr privconn, virDomainDefPtr def)
 {
-    vzConnPtr privconn = conn->privateData;
     PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
     PRL_HANDLE job = PRL_INVALID_HANDLE;
     PRL_HANDLE result = PRL_INVALID_HANDLE;
@@ -3772,7 +3770,7 @@ prlsdkCreateVm(virConnectPtr conn, virDomainDefPtr def)
     pret = PrlVmCfg_SetOfflineManagementEnabled(sdkdom, 0);
     prlsdkCheckRetGoto(pret, cleanup);
 
-    ret = prlsdkDoApplyConfig(conn, sdkdom, def, NULL);
+    ret = prlsdkDoApplyConfig(privconn, sdkdom, def, NULL);
     if (ret)
         goto cleanup;
 
@@ -3786,9 +3784,8 @@ prlsdkCreateVm(virConnectPtr conn, virDomainDefPtr def)
 }
 
 int
-prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def)
+prlsdkCreateCt(vzConnPtr privconn, virDomainDefPtr def)
 {
-    vzConnPtr privconn = conn->privateData;
     PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
     PRL_GET_VM_CONFIG_PARAM_DATA confParam;
     PRL_HANDLE job = PRL_INVALID_HANDLE;
@@ -3834,7 +3831,7 @@ prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def)
 
     }
 
-    ret = prlsdkDoApplyConfig(conn, sdkdom, def, NULL);
+    ret = prlsdkDoApplyConfig(privconn, sdkdom, def, NULL);
     if (ret)
         goto cleanup;
 
diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h
index 2f11d4f..a1b2e52 100644
--- a/src/vz/vz_sdk.h
+++ b/src/vz/vz_sdk.h
@@ -53,11 +53,11 @@ prlsdkDomainChangeStateLocked(vzConnPtr privconn,
                               virDomainObjPtr dom,
                               prlsdkChangeStateFunc chstate);
 int
-prlsdkApplyConfig(virConnectPtr conn,
+prlsdkApplyConfig(vzConnPtr privconn,
                   virDomainObjPtr dom,
                   virDomainDefPtr new);
-int prlsdkCreateVm(virConnectPtr conn, virDomainDefPtr def);
-int prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def);
+int prlsdkCreateVm(vzConnPtr privconn, virDomainDefPtr def);
+int prlsdkCreateCt(vzConnPtr privconn, virDomainDefPtr def);
 int
 prlsdkUnregisterDomain(vzConnPtr privconn, virDomainObjPtr dom, unsigned int flags);
 int
-- 
2.4.3

--
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]