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,
|
virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
|
||||||
virStoragePoolDefPtr def)
|
virStoragePoolDefPtr def)
|
||||||
{
|
{
|
||||||
@ -279,10 +279,10 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virStoragePoolObjPtr
|
static virStoragePoolObjPtr
|
||||||
virStoragePoolLoadState(virStoragePoolObjListPtr pools,
|
virStoragePoolObjLoadState(virStoragePoolObjListPtr pools,
|
||||||
const char *stateDir,
|
const char *stateDir,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
char *stateFile = NULL;
|
char *stateFile = NULL;
|
||||||
virStoragePoolDefPtr def = NULL;
|
virStoragePoolDefPtr def = NULL;
|
||||||
@ -339,8 +339,8 @@ virStoragePoolLoadState(virStoragePoolObjListPtr pools,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools,
|
||||||
const char *stateDir)
|
const char *stateDir)
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
@ -356,7 +356,8 @@ virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
|||||||
if (!virFileStripSuffix(entry->d_name, ".xml"))
|
if (!virFileStripSuffix(entry->d_name, ".xml"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(pool = virStoragePoolLoadState(pools, stateDir, entry->d_name)))
|
if (!(pool = virStoragePoolObjLoadState(pools, stateDir,
|
||||||
|
entry->d_name)))
|
||||||
continue;
|
continue;
|
||||||
virStoragePoolObjUnlock(pool);
|
virStoragePoolObjUnlock(pool);
|
||||||
}
|
}
|
||||||
@ -367,9 +368,9 @@ virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolLoadAllConfigs(virStoragePoolObjListPtr pools,
|
virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools,
|
||||||
const char *configDir,
|
const char *configDir,
|
||||||
const char *autostartDir)
|
const char *autostartDir)
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
@ -697,9 +698,9 @@ virStoragePoolSourceISCSIMatch(virStoragePoolObjPtr matchpool,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolSourceFindDuplicate(virConnectPtr conn,
|
virStoragePoolObjSourceFindDuplicate(virConnectPtr conn,
|
||||||
virStoragePoolObjListPtr pools,
|
virStoragePoolObjListPtr pools,
|
||||||
virStoragePoolDefPtr def)
|
virStoragePoolDefPtr def)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
@ -77,18 +77,13 @@ virStoragePoolObjIsActive(virStoragePoolObjPtr pool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolLoadAllConfigs(virStoragePoolObjListPtr pools,
|
virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools,
|
||||||
const char *configDir,
|
const char *configDir,
|
||||||
const char *autostartDir);
|
const char *autostartDir);
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolLoadAllState(virStoragePoolObjListPtr pools,
|
virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools,
|
||||||
const char *stateDir);
|
const char *stateDir);
|
||||||
|
|
||||||
virStoragePoolObjPtr
|
|
||||||
virStoragePoolLoadState(virStoragePoolObjListPtr pools,
|
|
||||||
const char *stateDir,
|
|
||||||
const char *name);
|
|
||||||
|
|
||||||
virStoragePoolObjPtr
|
virStoragePoolObjPtr
|
||||||
virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools,
|
virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools,
|
||||||
@ -98,10 +93,6 @@ virStoragePoolObjPtr
|
|||||||
virStoragePoolObjFindByName(virStoragePoolObjListPtr pools,
|
virStoragePoolObjFindByName(virStoragePoolObjListPtr pools,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
virStoragePoolObjPtr
|
|
||||||
virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
|
|
||||||
virStoragePoolDefPtr def);
|
|
||||||
|
|
||||||
virStorageVolDefPtr
|
virStorageVolDefPtr
|
||||||
virStorageVolDefFindByKey(virStoragePoolObjPtr pool,
|
virStorageVolDefFindByKey(virStoragePoolObjPtr pool,
|
||||||
const char *key);
|
const char *key);
|
||||||
@ -145,9 +136,9 @@ virStoragePoolObjIsDuplicate(virStoragePoolObjListPtr pools,
|
|||||||
unsigned int check_active);
|
unsigned int check_active);
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolSourceFindDuplicate(virConnectPtr conn,
|
virStoragePoolObjSourceFindDuplicate(virConnectPtr conn,
|
||||||
virStoragePoolObjListPtr pools,
|
virStoragePoolObjListPtr pools,
|
||||||
virStoragePoolDefPtr def);
|
virStoragePoolDefPtr def);
|
||||||
|
|
||||||
void
|
void
|
||||||
virStoragePoolObjLock(virStoragePoolObjPtr obj);
|
virStoragePoolObjLock(virStoragePoolObjPtr obj);
|
||||||
|
@ -983,8 +983,6 @@ virSecretObjSetValueSize;
|
|||||||
|
|
||||||
|
|
||||||
# conf/virstorageobj.h
|
# conf/virstorageobj.h
|
||||||
virStoragePoolLoadAllConfigs;
|
|
||||||
virStoragePoolLoadAllState;
|
|
||||||
virStoragePoolObjAssignDef;
|
virStoragePoolObjAssignDef;
|
||||||
virStoragePoolObjClearVols;
|
virStoragePoolObjClearVols;
|
||||||
virStoragePoolObjDeleteDef;
|
virStoragePoolObjDeleteDef;
|
||||||
@ -993,12 +991,13 @@ virStoragePoolObjFindByUUID;
|
|||||||
virStoragePoolObjIsDuplicate;
|
virStoragePoolObjIsDuplicate;
|
||||||
virStoragePoolObjListExport;
|
virStoragePoolObjListExport;
|
||||||
virStoragePoolObjListFree;
|
virStoragePoolObjListFree;
|
||||||
|
virStoragePoolObjLoadAllConfigs;
|
||||||
|
virStoragePoolObjLoadAllState;
|
||||||
virStoragePoolObjLock;
|
virStoragePoolObjLock;
|
||||||
virStoragePoolObjRemove;
|
virStoragePoolObjRemove;
|
||||||
virStoragePoolObjSaveDef;
|
virStoragePoolObjSaveDef;
|
||||||
|
virStoragePoolObjSourceFindDuplicate;
|
||||||
virStoragePoolObjUnlock;
|
virStoragePoolObjUnlock;
|
||||||
virStoragePoolSourceFindDuplicate;
|
|
||||||
virStoragePoolSourceFindDuplicateDevices;
|
|
||||||
|
|
||||||
|
|
||||||
# cpu/cpu.h
|
# cpu/cpu.h
|
||||||
|
@ -267,13 +267,13 @@ storageStateInitialize(bool privileged,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virStoragePoolLoadAllState(&driver->pools,
|
if (virStoragePoolObjLoadAllState(&driver->pools,
|
||||||
driver->stateDir) < 0)
|
driver->stateDir) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virStoragePoolLoadAllConfigs(&driver->pools,
|
if (virStoragePoolObjLoadAllConfigs(&driver->pools,
|
||||||
driver->configDir,
|
driver->configDir,
|
||||||
driver->autostartDir) < 0)
|
driver->autostartDir) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
storagePoolUpdateAllState();
|
storagePoolUpdateAllState();
|
||||||
@ -323,11 +323,11 @@ storageStateReload(void)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
storageDriverLock();
|
storageDriverLock();
|
||||||
virStoragePoolLoadAllState(&driver->pools,
|
virStoragePoolObjLoadAllState(&driver->pools,
|
||||||
driver->stateDir);
|
driver->stateDir);
|
||||||
virStoragePoolLoadAllConfigs(&driver->pools,
|
virStoragePoolObjLoadAllConfigs(&driver->pools,
|
||||||
driver->configDir,
|
driver->configDir,
|
||||||
driver->autostartDir);
|
driver->autostartDir);
|
||||||
storageDriverAutostart();
|
storageDriverAutostart();
|
||||||
storageDriverUnlock();
|
storageDriverUnlock();
|
||||||
|
|
||||||
@ -695,7 +695,7 @@ storagePoolCreateXML(virConnectPtr conn,
|
|||||||
if (virStoragePoolObjIsDuplicate(&driver->pools, def, 1) < 0)
|
if (virStoragePoolObjIsDuplicate(&driver->pools, def, 1) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virStoragePoolSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
if (virStoragePoolObjSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((backend = virStorageBackendForType(def->type)) == NULL)
|
if ((backend = virStorageBackendForType(def->type)) == NULL)
|
||||||
@ -790,7 +790,7 @@ storagePoolDefineXML(virConnectPtr conn,
|
|||||||
if (virStoragePoolObjIsDuplicate(&driver->pools, def, 0) < 0)
|
if (virStoragePoolObjIsDuplicate(&driver->pools, def, 0) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virStoragePoolSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
if (virStoragePoolObjSourceFindDuplicate(conn, &driver->pools, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virStorageBackendForType(def->type) == NULL)
|
if (virStorageBackendForType(def->type) == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user