mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +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);
|
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;
|
||||||
|
@ -2357,14 +2357,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,
|
||||||
@ -2393,6 +2385,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)
|
|||||||
|
|
||||||
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,
|
|||||||
|
|
||||||
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,
|
|||||||
|
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user