[PATCH 6/7] storage: Pass driver arg by ref

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

 



Alter virStoragePoolObjListExport in order to pass the drivers->pools
by reference

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/virstorageobj.c     | 8 ++++----
 src/conf/virstorageobj.h     | 2 +-
 src/storage/storage_driver.c | 2 +-
 src/test/test_driver.c       | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index a9367a2..34a3225 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -1100,7 +1100,7 @@ virStoragePoolMatch(virStoragePoolObjPtr poolobj,
 
 int
 virStoragePoolObjListExport(virConnectPtr conn,
-                            virStoragePoolObjList poolobjs,
+                            virStoragePoolObjListPtr poolobjs,
                             virStoragePoolPtr **pools,
                             virStoragePoolObjListFilter filter,
                             unsigned int flags)
@@ -1111,11 +1111,11 @@ virStoragePoolObjListExport(virConnectPtr conn,
     int ret = -1;
     size_t i;
 
-    if (pools && VIR_ALLOC_N(tmp_pools, poolobjs.count + 1) < 0)
+    if (pools && VIR_ALLOC_N(tmp_pools, poolobjs->count + 1) < 0)
         goto cleanup;
 
-    for (i = 0; i < poolobjs.count; i++) {
-        virStoragePoolObjPtr poolobj = poolobjs.objs[i];
+    for (i = 0; i < poolobjs->count; i++) {
+        virStoragePoolObjPtr poolobj = poolobjs->objs[i];
         virStoragePoolObjLock(poolobj);
         if ((!filter || filter(conn, poolobj->def)) &&
             virStoragePoolMatch(poolobj, flags)) {
diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h
index b651865..7c11910 100644
--- a/src/conf/virstorageobj.h
+++ b/src/conf/virstorageobj.h
@@ -191,7 +191,7 @@ virStoragePoolObjUnlock(virStoragePoolObjPtr obj);
 
 int
 virStoragePoolObjListExport(virConnectPtr conn,
-                            virStoragePoolObjList poolobjs,
+                            virStoragePoolObjListPtr poolobjs,
                             virStoragePoolPtr **pools,
                             virStoragePoolObjListFilter filter,
                             unsigned int flags);
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 9493da8..6b8bbb5 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -2653,7 +2653,7 @@ storageConnectListAllStoragePools(virConnectPtr conn,
         goto cleanup;
 
     storageDriverLock();
-    ret = virStoragePoolObjListExport(conn, driver->pools, pools,
+    ret = virStoragePoolObjListExport(conn, &driver->pools, pools,
                                       virConnectListAllStoragePoolsCheckACL,
                                       flags);
     storageDriverUnlock();
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 1a6601e..a2a17ef 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -4194,7 +4194,7 @@ testConnectListAllStoragePools(virConnectPtr conn,
     virCheckFlags(VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL, -1);
 
     testDriverLock(privconn);
-    ret = virStoragePoolObjListExport(conn, privconn->pools, pools,
+    ret = virStoragePoolObjListExport(conn, &privconn->pools, pools,
                                       NULL, flags);
     testDriverUnlock(privconn);
 
-- 
2.9.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]
  Powered by Linux