mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
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: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 7c8028cda9
)
This commit is contained in:
parent
edf314d710
commit
10283d240c
@ -16366,7 +16366,7 @@ virDomainObjParseXML(xmlDocPtr xml,
|
||||
VIR_FREE(nodes);
|
||||
|
||||
if (xmlopt->privateData.parse &&
|
||||
xmlopt->privateData.parse(ctxt, obj) < 0)
|
||||
xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0)
|
||||
goto error;
|
||||
|
||||
return obj;
|
||||
|
@ -2357,14 +2357,6 @@ typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn,
|
||||
typedef struct _virDomainXMLOption virDomainXMLOption;
|
||||
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
|
||||
* overall domain defaults. */
|
||||
typedef int (*virDomainDefPostParseCallback)(virDomainDefPtr def,
|
||||
@ -2393,6 +2385,15 @@ struct _virDomainDefParserConfig {
|
||||
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 virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr;
|
||||
struct _virDomainXMLPrivateDataCallbacks {
|
||||
|
@ -224,7 +224,8 @@ libxlDomainObjPrivateFree(void *data)
|
||||
|
||||
static int
|
||||
libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
virDomainObjPtr vm)
|
||||
virDomainObjPtr vm,
|
||||
virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED)
|
||||
{
|
||||
libxlDomainObjPrivatePtr priv = vm->privateData;
|
||||
|
||||
|
@ -65,7 +65,8 @@ virLXCDomainObjPrivateXMLFormat(virBufferPtr buf,
|
||||
|
||||
static int
|
||||
virLXCDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
virDomainObjPtr vm)
|
||||
virDomainObjPtr vm,
|
||||
virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virLXCDomainObjPrivatePtr priv = vm->privateData;
|
||||
unsigned long long thepid;
|
||||
|
@ -623,7 +623,8 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf,
|
||||
|
||||
static int
|
||||
qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
virDomainObjPtr vm)
|
||||
virDomainObjPtr vm,
|
||||
virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
char *monitorpath;
|
||||
|
Loading…
Reference in New Issue
Block a user