diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d021fbc22b..49b2de00d6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -20547,6 +20547,7 @@ virDomainObjParseXML(xmlDocPtr xml, int n; int state; int reason = 0; + void *parseOpaque = NULL; if (!(obj = virDomainObjNew(xmlopt))) return NULL; @@ -20618,8 +20619,11 @@ virDomainObjParseXML(xmlDocPtr xml, xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0) goto error; + if (xmlopt->privateData.getParseOpaque) + parseOpaque = xmlopt->privateData.getParseOpaque(obj); + /* callback to fill driver specific domain aspects */ - if (virDomainDefPostParse(obj->def, caps, flags, xmlopt, NULL) < 0) + if (virDomainDefPostParse(obj->def, caps, flags, xmlopt, parseOpaque) < 0) goto error; /* valdiate configuration */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e10206b358..7c89da371c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2663,6 +2663,8 @@ typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr, virDomainObjPtr, virDomainDefParserConfigPtr); +typedef void *(*virDomainXMLPrivateDataGetParseOpaqueFunc)(virDomainObjPtr vm); + typedef int (*virDomainXMLPrivateDataStorageSourceParseFunc)(xmlXPathContextPtr ctxt, virStorageSourcePtr src); typedef int (*virDomainXMLPrivateDataStorageSourceFormatFunc)(virStorageSourcePtr src, @@ -2681,6 +2683,9 @@ struct _virDomainXMLPrivateDataCallbacks { virDomainXMLPrivateDataNewFunc chrSourceNew; virDomainXMLPrivateDataFormatFunc format; virDomainXMLPrivateDataParseFunc parse; + /* following function shall return a pointer which will be used as the + * 'parseOpaque' argument for virDomainDefPostParse */ + virDomainXMLPrivateDataGetParseOpaqueFunc getParseOpaque; virDomainXMLPrivateDataStorageSourceParseFunc storageParse; virDomainXMLPrivateDataStorageSourceFormatFunc storageFormat; };