From babf148a9421f04d09a0e36596bc74ba2eeb4a28 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 21 Mar 2017 10:07:46 -0400 Subject: [PATCH] storage: Pass driver arg by ref Alter virStoragePoolObjListExport in order to pass the drivers->pools by reference Signed-off-by: John Ferlan --- 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 b199a51a1a..6e585fa0d9 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -1099,7 +1099,7 @@ virStoragePoolMatch(virStoragePoolObjPtr poolobj, int virStoragePoolObjListExport(virConnectPtr conn, - virStoragePoolObjList poolobjs, + virStoragePoolObjListPtr poolobjs, virStoragePoolPtr **pools, virStoragePoolObjListFilter filter, unsigned int flags) @@ -1110,11 +1110,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 b65186502c..7c119102b6 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 ae96b86f04..31e5e85175 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2647,7 +2647,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 6e4e9a0f3f..46ebdcc96f 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4177,7 +4177,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);