提交 7cc30e0e 编写于 作者: J John Ferlan

storage: Alter volume num, name, and export API's to just take obj

Alter the virStoragePoolObjNumOfVolumes, virStoragePoolObjVolumeGetNames,
and virStoragePoolObjVolumeListExport APIs to take a virStoragePoolObjPtr
instead of the &obj->volumes and obj->def.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 905f1024
......@@ -196,11 +196,12 @@ virStorageVolDefFindByName(virStoragePoolObjPtr obj,
int
virStoragePoolObjNumOfVolumes(virStorageVolDefListPtr volumes,
virStoragePoolObjNumOfVolumes(virStoragePoolObjPtr obj,
virConnectPtr conn,
virStoragePoolDefPtr pooldef,
virStoragePoolVolumeACLFilter aclfilter)
{
virStoragePoolDefPtr pooldef = obj->def;
virStorageVolDefListPtr volumes = &obj->volumes;
int nvolumes = 0;
size_t i;
......@@ -216,13 +217,14 @@ virStoragePoolObjNumOfVolumes(virStorageVolDefListPtr volumes,
int
virStoragePoolObjVolumeGetNames(virStorageVolDefListPtr volumes,
virStoragePoolObjVolumeGetNames(virStoragePoolObjPtr obj,
virConnectPtr conn,
virStoragePoolDefPtr pooldef,
virStoragePoolVolumeACLFilter aclfilter,
char **const names,
int maxnames)
{
virStoragePoolDefPtr pooldef = obj->def;
virStorageVolDefListPtr volumes = &obj->volumes;
int nnames = 0;
size_t i;
......@@ -247,11 +249,12 @@ virStoragePoolObjVolumeGetNames(virStorageVolDefListPtr volumes,
int
virStoragePoolObjVolumeListExport(virConnectPtr conn,
virStorageVolDefListPtr volumes,
virStoragePoolDefPtr pooldef,
virStoragePoolObjPtr obj,
virStorageVolPtr **vols,
virStoragePoolVolumeACLFilter aclfilter)
{
virStoragePoolDefPtr pooldef = obj->def;
virStorageVolDefListPtr volumes = &obj->volumes;
int ret = -1;
size_t i;
virStorageVolPtr *tmp_vols = NULL;
......
......@@ -114,23 +114,20 @@ typedef bool
virStorageVolDefPtr def);
int
virStoragePoolObjNumOfVolumes(virStorageVolDefListPtr volumes,
virStoragePoolObjNumOfVolumes(virStoragePoolObjPtr obj,
virConnectPtr conn,
virStoragePoolDefPtr pooldef,
virStoragePoolVolumeACLFilter aclfilter);
int
virStoragePoolObjVolumeGetNames(virStorageVolDefListPtr volumes,
virStoragePoolObjVolumeGetNames(virStoragePoolObjPtr obj,
virConnectPtr conn,
virStoragePoolDefPtr pooldef,
virStoragePoolVolumeACLFilter aclfilter,
char **const names,
int maxnames);
int
virStoragePoolObjVolumeListExport(virConnectPtr conn,
virStorageVolDefListPtr volumes,
virStoragePoolDefPtr pooldef,
virStoragePoolObjPtr obj,
virStorageVolPtr **vols,
virStoragePoolVolumeACLFilter aclfilter);
......
......@@ -1339,7 +1339,7 @@ storagePoolNumOfVolumes(virStoragePoolPtr pool)
goto cleanup;
}
ret = virStoragePoolObjNumOfVolumes(&obj->volumes, pool->conn, obj->def,
ret = virStoragePoolObjNumOfVolumes(obj, pool->conn,
virStoragePoolNumOfVolumesCheckACL);
cleanup:
......@@ -1368,7 +1368,7 @@ storagePoolListVolumes(virStoragePoolPtr pool,
goto cleanup;
}
n = virStoragePoolObjVolumeGetNames(&obj->volumes, pool->conn, obj->def,
n = virStoragePoolObjVolumeGetNames(obj, pool->conn,
virStoragePoolListVolumesCheckACL,
names, maxnames);
cleanup:
......@@ -1399,8 +1399,7 @@ storagePoolListAllVolumes(virStoragePoolPtr pool,
goto cleanup;
}
ret = virStoragePoolObjVolumeListExport(pool->conn, &obj->volumes,
obj->def, vols,
ret = virStoragePoolObjVolumeListExport(pool->conn, obj, vols,
virStoragePoolListAllVolumesCheckACL);
......
......@@ -4771,8 +4771,7 @@ testStoragePoolNumOfVolumes(virStoragePoolPtr pool)
if (!(obj = testStoragePoolObjFindActiveByName(privconn, pool->name)))
return -1;
ret = virStoragePoolObjNumOfVolumes(&obj->volumes, pool->conn,
obj->def, NULL);
ret = virStoragePoolObjNumOfVolumes(obj, pool->conn, NULL);
virStoragePoolObjUnlock(obj);
return ret;
......@@ -4791,8 +4790,7 @@ testStoragePoolListVolumes(virStoragePoolPtr pool,
if (!(obj = testStoragePoolObjFindActiveByName(privconn, pool->name)))
return -1;
n = virStoragePoolObjVolumeGetNames(&obj->volumes, pool->conn,
obj->def, NULL, names, maxnames);
n = virStoragePoolObjVolumeGetNames(obj, pool->conn, NULL, names, maxnames);
virStoragePoolObjUnlock(obj);
return n;
......@@ -4819,8 +4817,7 @@ testStoragePoolListAllVolumes(virStoragePoolPtr pool,
goto cleanup;
}
ret = virStoragePoolObjVolumeListExport(pool->conn, &obj->volumes,
obj->def, vols, NULL);
ret = virStoragePoolObjVolumeListExport(pool->conn, obj, vols, NULL);
cleanup:
virStoragePoolObjUnlock(obj);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册