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(a)redhat.com>
---
src/conf/virstorageobj.c | 29 +++++++++++++++--------------
src/conf/virstorageobj.h | 25 ++++++++-----------------
src/libvirt_private.syms | 7 +++----
src/storage/storage_driver.c | 24 ++++++++++++------------
4 files changed, 38 insertions(+), 47 deletions(-)
diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index 12108d8..01b263d 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -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;
@@ -703,9 +704,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;
diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h
index 13cec72..ecba94e 100644
--- a/src/conf/virstorageobj.h
+++ b/src/conf/virstorageobj.h
@@ -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);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 030f58a..21ffc8f8 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -976,8 +976,6 @@ virSecretObjSetValueSize;
# conf/virstorageobj.h
-virStoragePoolLoadAllConfigs;
-virStoragePoolLoadAllState;
virStoragePoolObjAssignDef;
virStoragePoolObjClearVols;
virStoragePoolObjDeleteDef;
@@ -986,12 +984,13 @@ virStoragePoolObjFindByUUID;
virStoragePoolObjIsDuplicate;
virStoragePoolObjListExport;
virStoragePoolObjListFree;
+virStoragePoolObjLoadAllConfigs;
+virStoragePoolObjLoadAllState;
virStoragePoolObjLock;
virStoragePoolObjRemove;
virStoragePoolObjSaveDef;
+virStoragePoolObjSourceFindDuplicate;
virStoragePoolObjUnlock;
-virStoragePoolSourceFindDuplicate;
-virStoragePoolSourceFindDuplicateDevices;
# cpu/cpu.h
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 0bc047f..287a862 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -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)
--
2.9.3