提交 5f617627 编写于 作者: J Ján Tomko

conf: storage: use generic XML namespace types

There is no need to copy and paste the same types pointing
to void all over the place.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 169ab538
......@@ -140,7 +140,7 @@ struct _virStoragePoolOptions {
int defaultFormat;
int lastFormat;
virStoragePoolXMLNamespace ns;
virXMLNamespace ns;
virStoragePoolFormatToString formatToString;
virStoragePoolFormatFromString formatFromString;
......@@ -341,7 +341,7 @@ virStoragePoolOptionsForPoolType(int type)
*/
int
virStoragePoolOptionsPoolTypeSetXMLNamespace(int type,
virStoragePoolXMLNamespacePtr ns)
virXMLNamespacePtr ns)
{
int ret = -1;
virStoragePoolTypeInfoPtr backend = virStoragePoolTypeInfoLookup(type);
......
......@@ -31,28 +31,13 @@
#include "storage_adapter_conf.h"
#include "virautoclean.h"
#include "virenum.h"
#include "virxml.h"
#include <libxml/tree.h>
/* Various callbacks needed to parse/create Storage Pool XML's using
* a private namespace */
typedef int (*virStoragePoolDefNamespaceParse)(xmlXPathContextPtr, void **);
typedef void (*virStoragePoolDefNamespaceFree)(void *);
typedef int (*virStoragePoolDefNamespaceXMLFormat)(virBufferPtr, void *);
typedef const char *(*virStoragePoolDefNamespaceHref)(void);
typedef struct _virStoragePoolXMLNamespace virStoragePoolXMLNamespace;
typedef virStoragePoolXMLNamespace *virStoragePoolXMLNamespacePtr;
struct _virStoragePoolXMLNamespace {
virStoragePoolDefNamespaceParse parse;
virStoragePoolDefNamespaceFree free;
virStoragePoolDefNamespaceXMLFormat format;
virStoragePoolDefNamespaceHref href;
};
int
virStoragePoolOptionsPoolTypeSetXMLNamespace(int type,
virStoragePoolXMLNamespacePtr ns);
virXMLNamespacePtr ns);
int
virStoragePoolOptionsFormatPool(virBufferPtr buf,
......@@ -277,7 +262,7 @@ struct _virStoragePoolDef {
/* Pool backend specific XML namespace data */
void *namespaceData;
virStoragePoolXMLNamespace ns;
virXMLNamespace ns;
};
typedef struct _virStoragePoolSourceList virStoragePoolSourceList;
......
......@@ -701,7 +701,7 @@ virStorageBackend virStorageBackendNetFileSystem = {
.wipeVol = virStorageBackendVolWipeLocal,
};
static virStoragePoolXMLNamespace virStoragePoolFSXMLNamespace = {
static virXMLNamespace virStoragePoolFSXMLNamespace = {
.parse = virStoragePoolDefFSNamespaceParse,
.free = virStoragePoolDefFSNamespaceFree,
.format = virStoragePoolDefFSNamespaceFormatXML,
......
......@@ -1542,7 +1542,7 @@ virStorageBackend virStorageBackendRBD = {
};
static virStoragePoolXMLNamespace virStoragePoolRBDXMLNamespace = {
static virXMLNamespace virStoragePoolRBDXMLNamespace = {
.parse = virStoragePoolDefRBDNamespaceParse,
.free = virStoragePoolDefRBDNamespaceFree,
.format = virStoragePoolDefRBDNamespaceFormatXML,
......
......@@ -92,7 +92,7 @@ VIR_LOG_INIT("storage.storage_util");
*/
int
virStorageBackendNamespaceInit(int poolType,
virStoragePoolXMLNamespacePtr xmlns)
virXMLNamespacePtr xmlns)
{
return virStoragePoolOptionsPoolTypeSetXMLNamespace(poolType, xmlns);
}
......
......@@ -36,7 +36,7 @@ struct _virStoragePoolFSMountOptionsDef {
int
virStorageBackendNamespaceInit(int poolType,
virStoragePoolXMLNamespacePtr xmlns);
virXMLNamespacePtr xmlns);
/* File creation/cloning functions used for cloning between backends */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册