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
|
* @pools: Storage Pool object list pointer
|
||||||
* @def: Storage pool definition to add or update
|
* @def: Storage pool definition to add or update
|
||||||
* @check_active: If true, ensure that pool is not active
|
* @check_active: If true, ensure that pool is not active
|
||||||
@ -1517,9 +1517,9 @@ virStoragePoolObjSourceFindDuplicate(virStoragePoolObjListPtr pools,
|
|||||||
* Returns locked and reffed object pointer or NULL on error
|
* Returns locked and reffed object pointer or NULL on error
|
||||||
*/
|
*/
|
||||||
virStoragePoolObjPtr
|
virStoragePoolObjPtr
|
||||||
virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
|
virStoragePoolObjListAdd(virStoragePoolObjListPtr pools,
|
||||||
virStoragePoolDefPtr def,
|
virStoragePoolDefPtr def,
|
||||||
bool check_active)
|
bool check_active)
|
||||||
{
|
{
|
||||||
virStoragePoolObjPtr obj = NULL;
|
virStoragePoolObjPtr obj = NULL;
|
||||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
@ -1590,7 +1590,7 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(obj = virStoragePoolObjAssignDef(pools, def, false)))
|
if (!(obj = virStoragePoolObjListAdd(pools, def, false)))
|
||||||
return NULL;
|
return NULL;
|
||||||
def = NULL;
|
def = NULL;
|
||||||
|
|
||||||
@ -1651,7 +1651,7 @@ virStoragePoolObjLoadState(virStoragePoolObjListPtr pools,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create the object */
|
/* create the object */
|
||||||
if (!(obj = virStoragePoolObjAssignDef(pools, def, true)))
|
if (!(obj = virStoragePoolObjListAdd(pools, def, true)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
def = NULL;
|
def = NULL;
|
||||||
|
|
||||||
|
@ -195,9 +195,9 @@ virStoragePoolObjVolumeListExport(virConnectPtr conn,
|
|||||||
virStoragePoolVolumeACLFilter filter);
|
virStoragePoolVolumeACLFilter filter);
|
||||||
|
|
||||||
virStoragePoolObjPtr
|
virStoragePoolObjPtr
|
||||||
virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
|
virStoragePoolObjListAdd(virStoragePoolObjListPtr pools,
|
||||||
virStoragePoolDefPtr def,
|
virStoragePoolDefPtr def,
|
||||||
bool check_active);
|
bool check_active);
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolObjSaveDef(virStorageDriverStatePtr driver,
|
virStoragePoolObjSaveDef(virStorageDriverStatePtr driver,
|
||||||
|
@ -1228,7 +1228,6 @@ virSecretObjSetValueSize;
|
|||||||
|
|
||||||
# conf/virstorageobj.h
|
# conf/virstorageobj.h
|
||||||
virStoragePoolObjAddVol;
|
virStoragePoolObjAddVol;
|
||||||
virStoragePoolObjAssignDef;
|
|
||||||
virStoragePoolObjClearVols;
|
virStoragePoolObjClearVols;
|
||||||
virStoragePoolObjDecrAsyncjobs;
|
virStoragePoolObjDecrAsyncjobs;
|
||||||
virStoragePoolObjDefUseNewDef;
|
virStoragePoolObjDefUseNewDef;
|
||||||
@ -1247,6 +1246,7 @@ virStoragePoolObjGetVolumesCount;
|
|||||||
virStoragePoolObjIncrAsyncjobs;
|
virStoragePoolObjIncrAsyncjobs;
|
||||||
virStoragePoolObjIsActive;
|
virStoragePoolObjIsActive;
|
||||||
virStoragePoolObjIsAutostart;
|
virStoragePoolObjIsAutostart;
|
||||||
|
virStoragePoolObjListAdd;
|
||||||
virStoragePoolObjListExport;
|
virStoragePoolObjListExport;
|
||||||
virStoragePoolObjListForEach;
|
virStoragePoolObjListForEach;
|
||||||
virStoragePoolObjListNew;
|
virStoragePoolObjListNew;
|
||||||
|
@ -754,7 +754,7 @@ storagePoolCreateXML(virConnectPtr conn,
|
|||||||
if ((backend = virStorageBackendForType(newDef->type)) == NULL)
|
if ((backend = virStorageBackendForType(newDef->type)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(obj = virStoragePoolObjAssignDef(driver->pools, newDef, true)))
|
if (!(obj = virStoragePoolObjListAdd(driver->pools, newDef, true)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
newDef = NULL;
|
newDef = NULL;
|
||||||
def = virStoragePoolObjGetDef(obj);
|
def = virStoragePoolObjGetDef(obj);
|
||||||
@ -829,7 +829,7 @@ storagePoolDefineXML(virConnectPtr conn,
|
|||||||
if (virStorageBackendForType(newDef->type) == NULL)
|
if (virStorageBackendForType(newDef->type) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(obj = virStoragePoolObjAssignDef(driver->pools, newDef, false)))
|
if (!(obj = virStoragePoolObjListAdd(driver->pools, newDef, false)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
newDef = virStoragePoolObjGetNewDef(obj);
|
newDef = virStoragePoolObjGetNewDef(obj);
|
||||||
def = virStoragePoolObjGetDef(obj);
|
def = virStoragePoolObjGetDef(obj);
|
||||||
|
@ -1140,7 +1140,7 @@ testParseStorage(testDriverPtr privconn,
|
|||||||
if (!def)
|
if (!def)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(obj = virStoragePoolObjAssignDef(privconn->pools, def, false))) {
|
if (!(obj = virStoragePoolObjListAdd(privconn->pools, def, false))) {
|
||||||
virStoragePoolDefFree(def);
|
virStoragePoolDefFree(def);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -6436,7 +6436,7 @@ testStoragePoolCreateXML(virConnectPtr conn,
|
|||||||
if (!(newDef = virStoragePoolDefParseString(xml)))
|
if (!(newDef = virStoragePoolDefParseString(xml)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(obj = virStoragePoolObjAssignDef(privconn->pools, newDef, true)))
|
if (!(obj = virStoragePoolObjListAdd(privconn->pools, newDef, true)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
newDef = NULL;
|
newDef = NULL;
|
||||||
def = virStoragePoolObjGetDef(obj);
|
def = virStoragePoolObjGetDef(obj);
|
||||||
@ -6502,7 +6502,7 @@ testStoragePoolDefineXML(virConnectPtr conn,
|
|||||||
newDef->allocation = defaultPoolAlloc;
|
newDef->allocation = defaultPoolAlloc;
|
||||||
newDef->available = defaultPoolCap - defaultPoolAlloc;
|
newDef->available = defaultPoolCap - defaultPoolAlloc;
|
||||||
|
|
||||||
if (!(obj = virStoragePoolObjAssignDef(privconn->pools, newDef, false)))
|
if (!(obj = virStoragePoolObjListAdd(privconn->pools, newDef, false)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
newDef = NULL;
|
newDef = NULL;
|
||||||
def = virStoragePoolObjGetDef(obj);
|
def = virStoragePoolObjGetDef(obj);
|
||||||
|
Loading…
Reference in New Issue
Block a user