mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
virstorageobj: Rename virStoragePoolObjAssignDef
This function is doing much more than plain assigning pool definition to a pool object. Rename it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c7df2437d2
commit
7e08447e8f
@ -1506,7 +1506,7 @@ virStoragePoolObjSourceFindDuplicate(virStoragePoolObjListPtr pools,
|
||||
|
||||
|
||||
/**
|
||||
* virStoragePoolObjAssignDef:
|
||||
* virStoragePoolObjListAdd:
|
||||
* @pools: Storage Pool object list pointer
|
||||
* @def: Storage pool definition to add or update
|
||||
* @check_active: If true, ensure that pool is not active
|
||||
@ -1517,7 +1517,7 @@ virStoragePoolObjSourceFindDuplicate(virStoragePoolObjListPtr pools,
|
||||
* Returns locked and reffed object pointer or NULL on error
|
||||
*/
|
||||
virStoragePoolObjPtr
|
||||
virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
|
||||
virStoragePoolObjListAdd(virStoragePoolObjListPtr pools,
|
||||
virStoragePoolDefPtr def,
|
||||
bool check_active)
|
||||
{
|
||||
@ -1590,7 +1590,7 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(obj = virStoragePoolObjAssignDef(pools, def, false)))
|
||||
if (!(obj = virStoragePoolObjListAdd(pools, def, false)))
|
||||
return NULL;
|
||||
def = NULL;
|
||||
|
||||
@ -1651,7 +1651,7 @@ virStoragePoolObjLoadState(virStoragePoolObjListPtr pools,
|
||||
}
|
||||
|
||||
/* create the object */
|
||||
if (!(obj = virStoragePoolObjAssignDef(pools, def, true)))
|
||||
if (!(obj = virStoragePoolObjListAdd(pools, def, true)))
|
||||
goto cleanup;
|
||||
def = NULL;
|
||||
|
||||
|
@ -195,7 +195,7 @@ virStoragePoolObjVolumeListExport(virConnectPtr conn,
|
||||
virStoragePoolVolumeACLFilter filter);
|
||||
|
||||
virStoragePoolObjPtr
|
||||
virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
|
||||
virStoragePoolObjListAdd(virStoragePoolObjListPtr pools,
|
||||
virStoragePoolDefPtr def,
|
||||
bool check_active);
|
||||
|
||||
|
@ -1228,7 +1228,6 @@ virSecretObjSetValueSize;
|
||||
|
||||
# conf/virstorageobj.h
|
||||
virStoragePoolObjAddVol;
|
||||
virStoragePoolObjAssignDef;
|
||||
virStoragePoolObjClearVols;
|
||||
virStoragePoolObjDecrAsyncjobs;
|
||||
virStoragePoolObjDefUseNewDef;
|
||||
@ -1247,6 +1246,7 @@ virStoragePoolObjGetVolumesCount;
|
||||
virStoragePoolObjIncrAsyncjobs;
|
||||
virStoragePoolObjIsActive;
|
||||
virStoragePoolObjIsAutostart;
|
||||
virStoragePoolObjListAdd;
|
||||
virStoragePoolObjListExport;
|
||||
virStoragePoolObjListForEach;
|
||||
virStoragePoolObjListNew;
|
||||
|
@ -754,7 +754,7 @@ storagePoolCreateXML(virConnectPtr conn,
|
||||
if ((backend = virStorageBackendForType(newDef->type)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (!(obj = virStoragePoolObjAssignDef(driver->pools, newDef, true)))
|
||||
if (!(obj = virStoragePoolObjListAdd(driver->pools, newDef, true)))
|
||||
goto cleanup;
|
||||
newDef = NULL;
|
||||
def = virStoragePoolObjGetDef(obj);
|
||||
@ -829,7 +829,7 @@ storagePoolDefineXML(virConnectPtr conn,
|
||||
if (virStorageBackendForType(newDef->type) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (!(obj = virStoragePoolObjAssignDef(driver->pools, newDef, false)))
|
||||
if (!(obj = virStoragePoolObjListAdd(driver->pools, newDef, false)))
|
||||
goto cleanup;
|
||||
newDef = virStoragePoolObjGetNewDef(obj);
|
||||
def = virStoragePoolObjGetDef(obj);
|
||||
|
@ -1140,7 +1140,7 @@ testParseStorage(testDriverPtr privconn,
|
||||
if (!def)
|
||||
return -1;
|
||||
|
||||
if (!(obj = virStoragePoolObjAssignDef(privconn->pools, def, false))) {
|
||||
if (!(obj = virStoragePoolObjListAdd(privconn->pools, def, false))) {
|
||||
virStoragePoolDefFree(def);
|
||||
return -1;
|
||||
}
|
||||
@ -6436,7 +6436,7 @@ testStoragePoolCreateXML(virConnectPtr conn,
|
||||
if (!(newDef = virStoragePoolDefParseString(xml)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(obj = virStoragePoolObjAssignDef(privconn->pools, newDef, true)))
|
||||
if (!(obj = virStoragePoolObjListAdd(privconn->pools, newDef, true)))
|
||||
goto cleanup;
|
||||
newDef = NULL;
|
||||
def = virStoragePoolObjGetDef(obj);
|
||||
@ -6502,7 +6502,7 @@ testStoragePoolDefineXML(virConnectPtr conn,
|
||||
newDef->allocation = defaultPoolAlloc;
|
||||
newDef->available = defaultPoolCap - defaultPoolAlloc;
|
||||
|
||||
if (!(obj = virStoragePoolObjAssignDef(privconn->pools, newDef, false)))
|
||||
if (!(obj = virStoragePoolObjListAdd(privconn->pools, newDef, false)))
|
||||
goto cleanup;
|
||||
newDef = NULL;
|
||||
def = virStoragePoolObjGetDef(obj);
|
||||
|
Loading…
Reference in New Issue
Block a user