提交 7c8028cd 编写于 作者: M Martin Kletzander

conf: Pass private data to Parse function of XML options

This needs a reorder of XML option definitions.  It might come in handy
one day.
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 92ddffdb
...@@ -16553,7 +16553,7 @@ virDomainObjParseXML(xmlDocPtr xml, ...@@ -16553,7 +16553,7 @@ virDomainObjParseXML(xmlDocPtr xml,
VIR_FREE(nodes); VIR_FREE(nodes);
if (xmlopt->privateData.parse && if (xmlopt->privateData.parse &&
xmlopt->privateData.parse(ctxt, obj) < 0) xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0)
goto error; goto error;
return obj; return obj;
......
...@@ -2391,14 +2391,6 @@ typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn, ...@@ -2391,14 +2391,6 @@ typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn,
typedef struct _virDomainXMLOption virDomainXMLOption; typedef struct _virDomainXMLOption virDomainXMLOption;
typedef virDomainXMLOption *virDomainXMLOptionPtr; typedef virDomainXMLOption *virDomainXMLOptionPtr;
typedef void *(*virDomainXMLPrivateDataAllocFunc)(void);
typedef void (*virDomainXMLPrivateDataFreeFunc)(void *);
typedef virObjectPtr (*virDomainXMLPrivateDataNewFunc)(void);
typedef int (*virDomainXMLPrivateDataFormatFunc)(virBufferPtr,
virDomainObjPtr);
typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr,
virDomainObjPtr);
/* Called once after everything else has been parsed, for adjusting /* Called once after everything else has been parsed, for adjusting
* overall domain defaults. */ * overall domain defaults. */
typedef int (*virDomainDefPostParseCallback)(virDomainDefPtr def, typedef int (*virDomainDefPostParseCallback)(virDomainDefPtr def,
...@@ -2427,6 +2419,15 @@ struct _virDomainDefParserConfig { ...@@ -2427,6 +2419,15 @@ struct _virDomainDefParserConfig {
unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN]; unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN];
}; };
typedef void *(*virDomainXMLPrivateDataAllocFunc)(void);
typedef void (*virDomainXMLPrivateDataFreeFunc)(void *);
typedef virObjectPtr (*virDomainXMLPrivateDataNewFunc)(void);
typedef int (*virDomainXMLPrivateDataFormatFunc)(virBufferPtr,
virDomainObjPtr);
typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr,
virDomainObjPtr,
virDomainDefParserConfigPtr);
typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCallbacks; typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCallbacks;
typedef virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr; typedef virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr;
struct _virDomainXMLPrivateDataCallbacks { struct _virDomainXMLPrivateDataCallbacks {
......
...@@ -224,7 +224,8 @@ libxlDomainObjPrivateFree(void *data) ...@@ -224,7 +224,8 @@ libxlDomainObjPrivateFree(void *data)
static int static int
libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
virDomainObjPtr vm) virDomainObjPtr vm,
virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED)
{ {
libxlDomainObjPrivatePtr priv = vm->privateData; libxlDomainObjPrivatePtr priv = vm->privateData;
......
...@@ -65,7 +65,8 @@ virLXCDomainObjPrivateXMLFormat(virBufferPtr buf, ...@@ -65,7 +65,8 @@ virLXCDomainObjPrivateXMLFormat(virBufferPtr buf,
static int static int
virLXCDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, virLXCDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
virDomainObjPtr vm) virDomainObjPtr vm,
virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED)
{ {
virLXCDomainObjPrivatePtr priv = vm->privateData; virLXCDomainObjPrivatePtr priv = vm->privateData;
unsigned long long thepid; unsigned long long thepid;
......
...@@ -623,7 +623,8 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, ...@@ -623,7 +623,8 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf,
static int static int
qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
virDomainObjPtr vm) virDomainObjPtr vm,
virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
char *monitorpath; char *monitorpath;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册