storage: Pass driver arg by ref

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

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2017-03-21 10:07:46 -04:00
parent 50e6d4e8e1
commit babf148a94
4 changed files with 7 additions and 7 deletions

View File

@ -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)) {

View File

@ -191,7 +191,7 @@ virStoragePoolObjUnlock(virStoragePoolObjPtr obj);
int
virStoragePoolObjListExport(virConnectPtr conn,
virStoragePoolObjList poolobjs,
virStoragePoolObjListPtr poolobjs,
virStoragePoolPtr **pools,
virStoragePoolObjListFilter filter,
unsigned int flags);

View File

@ -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();

View File

@ -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);