You need to sign in or sign up before continuing.
提交 749c1bb3 编写于 作者: J John Ferlan

conf: Adjust coding style for storage conf sources

Alter the format of the code to follow more recent style guidelines of
two empty lines between functions, function decls with "[static] type"
on one line followed by function name with arguments to functions each
on one line.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 7c151e33
...@@ -142,6 +142,7 @@ struct _virStoragePoolTypeInfo { ...@@ -142,6 +142,7 @@ struct _virStoragePoolTypeInfo {
virStorageVolOptions volOptions; virStorageVolOptions volOptions;
}; };
static int static int
virStorageVolumeFormatFromString(const char *format) virStorageVolumeFormatFromString(const char *format)
{ {
...@@ -151,6 +152,7 @@ virStorageVolumeFormatFromString(const char *format) ...@@ -151,6 +152,7 @@ virStorageVolumeFormatFromString(const char *format)
return ret; return ret;
} }
static virStoragePoolTypeInfo poolTypeInfo[] = { static virStoragePoolTypeInfo poolTypeInfo[] = {
{.poolType = VIR_STORAGE_POOL_LOGICAL, {.poolType = VIR_STORAGE_POOL_LOGICAL,
.poolOptions = { .poolOptions = {
...@@ -300,6 +302,7 @@ virStoragePoolTypeInfoLookup(int type) ...@@ -300,6 +302,7 @@ virStoragePoolTypeInfoLookup(int type)
return NULL; return NULL;
} }
static virStoragePoolOptionsPtr static virStoragePoolOptionsPtr
virStoragePoolOptionsForPoolType(int type) virStoragePoolOptionsForPoolType(int type)
{ {
...@@ -309,6 +312,7 @@ virStoragePoolOptionsForPoolType(int type) ...@@ -309,6 +312,7 @@ virStoragePoolOptionsForPoolType(int type)
return &backend->poolOptions; return &backend->poolOptions;
} }
static virStorageVolOptionsPtr static virStorageVolOptionsPtr
virStorageVolOptionsForPoolType(int type) virStorageVolOptionsForPoolType(int type)
{ {
...@@ -338,6 +342,7 @@ virStorageVolDefFree(virStorageVolDefPtr def) ...@@ -338,6 +342,7 @@ virStorageVolDefFree(virStorageVolDefPtr def)
VIR_FREE(def); VIR_FREE(def);
} }
void void
virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev) virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev)
{ {
...@@ -345,6 +350,7 @@ virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev) ...@@ -345,6 +350,7 @@ virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev)
VIR_FREE(dev->path); VIR_FREE(dev->path);
} }
void void
virStoragePoolSourceClear(virStoragePoolSourcePtr source) virStoragePoolSourceClear(virStoragePoolSourcePtr source)
{ {
...@@ -369,6 +375,7 @@ virStoragePoolSourceClear(virStoragePoolSourcePtr source) ...@@ -369,6 +375,7 @@ virStoragePoolSourceClear(virStoragePoolSourcePtr source)
VIR_FREE(source->product); VIR_FREE(source->product);
} }
void void
virStoragePoolSourceFree(virStoragePoolSourcePtr source) virStoragePoolSourceFree(virStoragePoolSourcePtr source)
{ {
...@@ -376,6 +383,7 @@ virStoragePoolSourceFree(virStoragePoolSourcePtr source) ...@@ -376,6 +383,7 @@ virStoragePoolSourceFree(virStoragePoolSourcePtr source)
VIR_FREE(source); VIR_FREE(source);
} }
void void
virStoragePoolDefFree(virStoragePoolDefPtr def) virStoragePoolDefFree(virStoragePoolDefPtr def)
{ {
...@@ -544,6 +552,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, ...@@ -544,6 +552,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
return ret; return ret;
} }
virStoragePoolSourcePtr virStoragePoolSourcePtr
virStoragePoolDefParseSourceString(const char *srcSpec, virStoragePoolDefParseSourceString(const char *srcSpec,
int pool_type) int pool_type)
...@@ -581,6 +590,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec, ...@@ -581,6 +590,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec,
return ret; return ret;
} }
static int static int
virStorageDefParsePerms(xmlXPathContextPtr ctxt, virStorageDefParsePerms(xmlXPathContextPtr ctxt,
virStoragePermsPtr perms, virStoragePermsPtr perms,
...@@ -800,6 +810,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) ...@@ -800,6 +810,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
goto cleanup; goto cleanup;
} }
virStoragePoolDefPtr virStoragePoolDefPtr
virStoragePoolDefParseNode(xmlDocPtr xml, virStoragePoolDefParseNode(xmlDocPtr xml,
xmlNodePtr root) xmlNodePtr root)
...@@ -828,6 +839,7 @@ virStoragePoolDefParseNode(xmlDocPtr xml, ...@@ -828,6 +839,7 @@ virStoragePoolDefParseNode(xmlDocPtr xml,
return def; return def;
} }
static virStoragePoolDefPtr static virStoragePoolDefPtr
virStoragePoolDefParse(const char *xmlStr, virStoragePoolDefParse(const char *xmlStr,
const char *filename) const char *filename)
...@@ -843,12 +855,14 @@ virStoragePoolDefParse(const char *xmlStr, ...@@ -843,12 +855,14 @@ virStoragePoolDefParse(const char *xmlStr,
return ret; return ret;
} }
virStoragePoolDefPtr virStoragePoolDefPtr
virStoragePoolDefParseString(const char *xmlStr) virStoragePoolDefParseString(const char *xmlStr)
{ {
return virStoragePoolDefParse(xmlStr, NULL); return virStoragePoolDefParse(xmlStr, NULL);
} }
virStoragePoolDefPtr virStoragePoolDefPtr
virStoragePoolDefParseFile(const char *filename) virStoragePoolDefParseFile(const char *filename)
{ {
...@@ -1024,6 +1038,7 @@ virStoragePoolDefFormatBuf(virBufferPtr buf, ...@@ -1024,6 +1038,7 @@ virStoragePoolDefFormatBuf(virBufferPtr buf,
return 0; return 0;
} }
char * char *
virStoragePoolDefFormat(virStoragePoolDefPtr def) virStoragePoolDefFormat(virStoragePoolDefPtr def)
{ {
...@@ -1061,6 +1076,7 @@ virStorageSize(const char *unit, ...@@ -1061,6 +1076,7 @@ virStorageSize(const char *unit,
return 0; return 0;
} }
static virStorageVolDefPtr static virStorageVolDefPtr
virStorageVolDefParseXML(virStoragePoolDefPtr pool, virStorageVolDefParseXML(virStoragePoolDefPtr pool,
xmlXPathContextPtr ctxt, xmlXPathContextPtr ctxt,
...@@ -1236,6 +1252,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool, ...@@ -1236,6 +1252,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
goto cleanup; goto cleanup;
} }
virStorageVolDefPtr virStorageVolDefPtr
virStorageVolDefParseNode(virStoragePoolDefPtr pool, virStorageVolDefParseNode(virStoragePoolDefPtr pool,
xmlDocPtr xml, xmlDocPtr xml,
...@@ -1266,6 +1283,7 @@ virStorageVolDefParseNode(virStoragePoolDefPtr pool, ...@@ -1266,6 +1283,7 @@ virStorageVolDefParseNode(virStoragePoolDefPtr pool,
return def; return def;
} }
static virStorageVolDefPtr static virStorageVolDefPtr
virStorageVolDefParse(virStoragePoolDefPtr pool, virStorageVolDefParse(virStoragePoolDefPtr pool,
const char *xmlStr, const char *xmlStr,
...@@ -1283,6 +1301,7 @@ virStorageVolDefParse(virStoragePoolDefPtr pool, ...@@ -1283,6 +1301,7 @@ virStorageVolDefParse(virStoragePoolDefPtr pool,
return ret; return ret;
} }
virStorageVolDefPtr virStorageVolDefPtr
virStorageVolDefParseString(virStoragePoolDefPtr pool, virStorageVolDefParseString(virStoragePoolDefPtr pool,
const char *xmlStr, const char *xmlStr,
...@@ -1291,6 +1310,7 @@ virStorageVolDefParseString(virStoragePoolDefPtr pool, ...@@ -1291,6 +1310,7 @@ virStorageVolDefParseString(virStoragePoolDefPtr pool,
return virStorageVolDefParse(pool, xmlStr, NULL, flags); return virStorageVolDefParse(pool, xmlStr, NULL, flags);
} }
virStorageVolDefPtr virStorageVolDefPtr
virStorageVolDefParseFile(virStoragePoolDefPtr pool, virStorageVolDefParseFile(virStoragePoolDefPtr pool,
const char *filename, const char *filename,
...@@ -1299,6 +1319,7 @@ virStorageVolDefParseFile(virStoragePoolDefPtr pool, ...@@ -1299,6 +1319,7 @@ virStorageVolDefParseFile(virStoragePoolDefPtr pool,
return virStorageVolDefParse(pool, NULL, filename, flags); return virStorageVolDefParse(pool, NULL, filename, flags);
} }
static void static void
virStorageVolTimestampFormat(virBufferPtr buf, const char *name, virStorageVolTimestampFormat(virBufferPtr buf, const char *name,
struct timespec *ts) struct timespec *ts)
...@@ -1312,6 +1333,7 @@ virStorageVolTimestampFormat(virBufferPtr buf, const char *name, ...@@ -1312,6 +1333,7 @@ virStorageVolTimestampFormat(virBufferPtr buf, const char *name,
virBufferAsprintf(buf, "</%s>\n", name); virBufferAsprintf(buf, "</%s>\n", name);
} }
static int static int
virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferPtr buf, virBufferPtr buf,
...@@ -1403,6 +1425,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, ...@@ -1403,6 +1425,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
return 0; return 0;
} }
char * char *
virStorageVolDefFormat(virStoragePoolDefPtr pool, virStorageVolDefFormat(virStoragePoolDefPtr pool,
virStorageVolDefPtr def) virStorageVolDefPtr def)
...@@ -1485,7 +1508,8 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, ...@@ -1485,7 +1508,8 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool,
} }
static int virStoragePoolSaveXML(const char *path, static int
virStoragePoolSaveXML(const char *path,
virStoragePoolDefPtr def, virStoragePoolDefPtr def,
const char *xml) const char *xml)
{ {
...@@ -1572,6 +1596,7 @@ virStoragePoolSourceListNewSource(virStoragePoolSourceListPtr list) ...@@ -1572,6 +1596,7 @@ virStoragePoolSourceListNewSource(virStoragePoolSourceListPtr list)
return source; return source;
} }
char * char *
virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def) virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def)
{ {
......
...@@ -56,6 +56,7 @@ virStoragePoolObjFree(virStoragePoolObjPtr obj) ...@@ -56,6 +56,7 @@ virStoragePoolObjFree(virStoragePoolObjPtr obj)
VIR_FREE(obj); VIR_FREE(obj);
} }
void void
virStoragePoolObjListFree(virStoragePoolObjListPtr pools) virStoragePoolObjListFree(virStoragePoolObjListPtr pools)
{ {
...@@ -66,6 +67,7 @@ virStoragePoolObjListFree(virStoragePoolObjListPtr pools) ...@@ -66,6 +67,7 @@ virStoragePoolObjListFree(virStoragePoolObjListPtr pools)
pools->count = 0; pools->count = 0;
} }
void void
virStoragePoolObjRemove(virStoragePoolObjListPtr pools, virStoragePoolObjRemove(virStoragePoolObjListPtr pools,
virStoragePoolObjPtr pool) virStoragePoolObjPtr pool)
...@@ -104,6 +106,7 @@ virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools, ...@@ -104,6 +106,7 @@ virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools,
return NULL; return NULL;
} }
virStoragePoolObjPtr virStoragePoolObjPtr
virStoragePoolObjFindByName(virStoragePoolObjListPtr pools, virStoragePoolObjFindByName(virStoragePoolObjListPtr pools,
const char *name) const char *name)
...@@ -120,6 +123,7 @@ virStoragePoolObjFindByName(virStoragePoolObjListPtr pools, ...@@ -120,6 +123,7 @@ virStoragePoolObjFindByName(virStoragePoolObjListPtr pools,
return NULL; return NULL;
} }
virStoragePoolObjPtr virStoragePoolObjPtr
virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool, virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
virStoragePoolDefPtr def) virStoragePoolDefPtr def)
...@@ -136,6 +140,7 @@ virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool, ...@@ -136,6 +140,7 @@ virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
return NULL; return NULL;
} }
void void
virStoragePoolObjClearVols(virStoragePoolObjPtr pool) virStoragePoolObjClearVols(virStoragePoolObjPtr pool)
{ {
...@@ -147,6 +152,7 @@ virStoragePoolObjClearVols(virStoragePoolObjPtr pool) ...@@ -147,6 +152,7 @@ virStoragePoolObjClearVols(virStoragePoolObjPtr pool)
pool->volumes.count = 0; pool->volumes.count = 0;
} }
virStorageVolDefPtr virStorageVolDefPtr
virStorageVolDefFindByKey(virStoragePoolObjPtr pool, virStorageVolDefFindByKey(virStoragePoolObjPtr pool,
const char *key) const char *key)
...@@ -160,6 +166,7 @@ virStorageVolDefFindByKey(virStoragePoolObjPtr pool, ...@@ -160,6 +166,7 @@ virStorageVolDefFindByKey(virStoragePoolObjPtr pool,
return NULL; return NULL;
} }
virStorageVolDefPtr virStorageVolDefPtr
virStorageVolDefFindByPath(virStoragePoolObjPtr pool, virStorageVolDefFindByPath(virStoragePoolObjPtr pool,
const char *path) const char *path)
...@@ -173,6 +180,7 @@ virStorageVolDefFindByPath(virStoragePoolObjPtr pool, ...@@ -173,6 +180,7 @@ virStorageVolDefFindByPath(virStoragePoolObjPtr pool,
return NULL; return NULL;
} }
virStorageVolDefPtr virStorageVolDefPtr
virStorageVolDefFindByName(virStoragePoolObjPtr pool, virStorageVolDefFindByName(virStoragePoolObjPtr pool,
const char *name) const char *name)
...@@ -186,6 +194,7 @@ virStorageVolDefFindByName(virStoragePoolObjPtr pool, ...@@ -186,6 +194,7 @@ virStorageVolDefFindByName(virStoragePoolObjPtr pool,
return NULL; return NULL;
} }
virStoragePoolObjPtr virStoragePoolObjPtr
virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools, virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
virStoragePoolDefPtr def) virStoragePoolDefPtr def)
...@@ -225,6 +234,7 @@ virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools, ...@@ -225,6 +234,7 @@ virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
return pool; return pool;
} }
static virStoragePoolObjPtr static virStoragePoolObjPtr
virStoragePoolObjLoad(virStoragePoolObjListPtr pools, virStoragePoolObjLoad(virStoragePoolObjListPtr pools,
const char *file, const char *file,
...@@ -428,6 +438,7 @@ virStoragePoolObjSaveDef(virStorageDriverStatePtr driver, ...@@ -428,6 +438,7 @@ virStoragePoolObjSaveDef(virStorageDriverStatePtr driver,
return virStoragePoolSaveConfig(pool->configFile, def); return virStoragePoolSaveConfig(pool->configFile, def);
} }
int int
virStoragePoolObjDeleteDef(virStoragePoolObjPtr pool) virStoragePoolObjDeleteDef(virStoragePoolObjPtr pool)
{ {
...@@ -654,6 +665,7 @@ matchSCSIAdapterParent(virStorageAdapterSCSIHostPtr pool_scsi_host, ...@@ -654,6 +665,7 @@ matchSCSIAdapterParent(virStorageAdapterSCSIHostPtr pool_scsi_host,
return false; return false;
} }
static bool static bool
virStoragePoolSourceMatchSingleHost(virStoragePoolSourcePtr poolsrc, virStoragePoolSourceMatchSingleHost(virStoragePoolSourcePtr poolsrc,
virStoragePoolSourcePtr defsrc) virStoragePoolSourcePtr defsrc)
...@@ -848,18 +860,21 @@ virStoragePoolSourceFindDuplicate(virConnectPtr conn, ...@@ -848,18 +860,21 @@ virStoragePoolSourceFindDuplicate(virConnectPtr conn,
return ret; return ret;
} }
void void
virStoragePoolObjLock(virStoragePoolObjPtr obj) virStoragePoolObjLock(virStoragePoolObjPtr obj)
{ {
virMutexLock(&obj->lock); virMutexLock(&obj->lock);
} }
void void
virStoragePoolObjUnlock(virStoragePoolObjPtr obj) virStoragePoolObjUnlock(virStoragePoolObjPtr obj)
{ {
virMutexUnlock(&obj->lock); virMutexUnlock(&obj->lock);
} }
#define MATCH(FLAG) (flags & (FLAG)) #define MATCH(FLAG) (flags & (FLAG))
static bool static bool
virStoragePoolMatch(virStoragePoolObjPtr poolobj, virStoragePoolMatch(virStoragePoolObjPtr poolobj,
...@@ -924,6 +939,7 @@ virStoragePoolMatch(virStoragePoolObjPtr poolobj, ...@@ -924,6 +939,7 @@ virStoragePoolMatch(virStoragePoolObjPtr poolobj,
} }
#undef MATCH #undef MATCH
int int
virStoragePoolObjListExport(virConnectPtr conn, virStoragePoolObjListExport(virConnectPtr conn,
virStoragePoolObjList poolobjs, virStoragePoolObjList poolobjs,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册