mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
conf: Use consistent function name prefixes for virstorageobj
Use "virStoragePoolObj" as a prefix for any external API in virstorageobj. Also a couple of functions were local to virstorageobj.c, so remove their external defs iin virstorageobj.h. NB: The virStorageVolDef* API's won't change. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
84017c5954
commit
a6d681485f
@ -124,7 +124,7 @@ virStoragePoolObjFindByName(virStoragePoolObjListPtr pools,
|
||||
}
|
||||
|
||||
|
||||
virStoragePoolObjPtr
|
||||
static virStoragePoolObjPtr
|
||||
virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
|
||||
virStoragePoolDefPtr def)
|
||||
{
|
||||
@ -279,10 +279,10 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools,
|
||||
}
|
||||
|
||||
|
||||
virStoragePoolObjPtr
|
||||
virStoragePoolLoadState(virStoragePoolObjListPtr pools,
|
||||
const char *stateDir,
|
||||
const char *name)
|
||||
static virStoragePoolObjPtr
|
||||
virStoragePoolObjLoadState(virStoragePoolObjListPtr pools,
|
||||
const char *stateDir,
|
||||
const char *name)
|
||||
{
|
||||
char *stateFile = NULL;
|
||||
virStoragePoolDefPtr def = NULL;
|
||||
@ -339,8 +339,8 @@ virStoragePoolLoadState(virStoragePoolObjListPtr pools,
|
||||
|
||||
|
||||
int
|
||||
virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
||||
const char *stateDir)
|
||||
virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools,
|
||||
const char *stateDir)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
@ -356,7 +356,8 @@ virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
||||
if (!virFileStripSuffix(entry->d_name, ".xml"))
|
||||
continue;
|
||||
|
||||
if (!(pool = virStoragePoolLoadState(pools, stateDir, entry->d_name)))
|
||||
if (!(pool = virStoragePoolObjLoadState(pools, stateDir,
|
||||
entry->d_name)))
|
||||
continue;
|
||||
virStoragePoolObjUnlock(pool);
|
||||
}
|
||||
@ -367,9 +368,9 @@ virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
||||
|
||||
|
||||
int
|
||||
virStoragePoolLoadAllConfigs(virStoragePoolObjListPtr pools,
|
||||
const char *configDir,
|
||||
const char *autostartDir)
|
||||
virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools,
|
||||
const char *configDir,
|
||||
const char *autostartDir)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
@ -697,9 +698,9 @@ virStoragePoolSourceISCSIMatch(virStoragePoolObjPtr matchpool,
|
||||
|
||||
|
||||
int
|
||||
virStoragePoolSourceFindDuplicate(virConnectPtr conn,
|
||||
virStoragePoolObjListPtr pools,
|
||||
virStoragePoolDefPtr def)
|
||||
virStoragePoolObjSourceFindDuplicate(virConnectPtr conn,
|
||||
virStoragePoolObjListPtr pools,
|
||||
virStoragePoolDefPtr def)
|
||||
{
|
||||
size_t i;
|
||||
int ret = 1;
|
||||
|
@ -77,18 +77,13 @@ virStoragePoolObjIsActive(virStoragePoolObjPtr pool)
|
||||
}
|
||||
|
||||
int
|
||||
virStoragePoolLoadAllConfigs(virStoragePoolObjListPtr pools,
|
||||
const char *configDir,
|
||||
const char *autostartDir);
|
||||
virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools,
|
||||
const char *configDir,
|
||||
const char *autostartDir);
|
||||
|
||||
int
|
||||
virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
||||
const char *stateDir);
|
||||
|
||||
virStoragePoolObjPtr
|
||||
virStoragePoolLoadState(virStoragePoolObjListPtr pools,
|
||||
const char *stateDir,
|
||||
const char *name);
|
||||
virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools,
|
||||
const char *stateDir);
|
||||
|
||||
virStoragePoolObjPtr
|
||||
virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools,
|
||||
@ -98,10 +93,6 @@ virStoragePoolObjPtr
|
||||
virStoragePoolObjFindByName(virStoragePoolObjListPtr pools,
|
||||
const char *name);
|
||||
|
||||
virStoragePoolObjPtr
|
||||
virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
|
||||
virStoragePoolDefPtr def);
|
||||
|
||||
virStorageVolDefPtr
|
||||
virStorageVolDefFindByKey(virStoragePoolObjPtr pool,
|
||||
const char *key);
|
||||
@ -145,9 +136,9 @@ virStoragePoolObjIsDuplicate(virStoragePoolObjListPtr pools,
|
||||
unsigned int check_active);
|
||||
|
||||
int
|
||||
virStoragePoolSourceFindDuplicate(virConnectPtr conn,
|
||||
virStoragePoolObjListPtr pools,
|
||||
virStoragePoolDefPtr def);
|
||||
virStoragePoolObjSourceFindDuplicate(virConnectPtr conn,
|
||||
virStoragePoolObjListPtr pools,
|
||||
virStoragePoolDefPtr def);
|
||||
|
||||
void
|
||||
virStoragePoolObjLock(virStoragePoolObjPtr obj);
|
||||
|
@ -983,8 +983,6 @@ virSecretObjSetValueSize;
|
||||
|
||||
|
||||
# conf/virstorageobj.h
|
||||
virStoragePoolLoadAllConfigs;
|
||||
virStoragePoolLoadAllState;
|
||||
virStoragePoolObjAssignDef;
|
||||
virStoragePoolObjClearVols;
|
||||
virStoragePoolObjDeleteDef;
|
||||
@ -993,12 +991,13 @@ virStoragePoolObjFindByUUID;
|
||||
virStoragePoolObjIsDuplicate;
|
||||
virStoragePoolObjListExport;
|
||||
virStoragePoolObjListFree;
|
||||
virStoragePoolObjLoadAllConfigs;
|
||||
virStoragePoolObjLoadAllState;
|
||||
virStoragePoolObjLock;
|
||||
virStoragePoolObjRemove;
|
||||
virStoragePoolObjSaveDef;
|
||||
virStoragePoolObjSourceFindDuplicate;
|
||||
virStoragePoolObjUnlock;
|
||||
virStoragePoolSourceFindDuplicate;
|
||||
virStoragePoolSourceFindDuplicateDevices;
|
||||
|
||||
|
||||
# cpu/cpu.h
|
||||
|
@ -267,13 +267,13 @@ storageStateInitialize(bool privileged,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virStoragePoolLoadAllState(&driver->pools,
|
||||
driver->stateDir) < 0)
|
||||
if (virStoragePoolObjLoadAllState(&driver->pools,
|
||||
driver->stateDir) < 0)
|
||||
goto error;
|
||||
|
||||
if (virStoragePoolLoadAllConfigs(&driver->pools,
|
||||
driver->configDir,
|
||||
driver->autostartDir) < 0)
|
||||
if (virStoragePoolObjLoadAllConfigs(&driver->pools,
|
||||
driver->configDir,
|
||||
driver->autostartDir) < 0)
|
||||
goto error;
|
||||
|
||||
storagePoolUpdateAllState();
|
||||
@ -323,11 +323,11 @@ storageStateReload(void)
|
||||
return -1;
|
||||
|
||||
storageDriverLock();
|
||||
virStoragePoolLoadAllState(&driver->pools,
|
||||
driver->stateDir);
|
||||
virStoragePoolLoadAllConfigs(&driver->pools,
|
||||
driver->configDir,
|
||||
driver->autostartDir);
|
||||
virStoragePoolObjLoadAllState(&driver->pools,
|
||||
driver->stateDir);
|
||||
virStoragePoolObjLoadAllConfigs(&driver->pools,
|
||||
driver->configDir,
|
||||
driver->autostartDir);
|
||||
storageDriverAutostart();
|
||||
storageDriverUnlock();
|
||||
|
||||
@ -695,7 +695,7 @@ storagePoolCreateXML(virConnectPtr conn,
|
||||
if (virStoragePoolObjIsDuplicate(&driver->pools, def, 1) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virStoragePoolSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
||||
if (virStoragePoolObjSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if ((backend = virStorageBackendForType(def->type)) == NULL)
|
||||
@ -790,7 +790,7 @@ storagePoolDefineXML(virConnectPtr conn,
|
||||
if (virStoragePoolObjIsDuplicate(&driver->pools, def, 0) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virStoragePoolSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
||||
if (virStoragePoolObjSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virStorageBackendForType(def->type) == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user