This is an internal flag that prevents our two entry points to
XML parsing (virDomainDefParse and virDomainDeviceDefParse) from
running post parse callbacks. This is expected to be used in
cases when we already have full domain/device XML and we are just
parsing it back (i.e. virDomainDefCopy or virDomainDeviceDefCopy)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
{
int ret;
+ if (flags & VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE)
+ return 0;
+
if (xmlopt->config.devicesPostParseCallback) {
ret = xmlopt->config.devicesPostParseCallback(dev, def, caps, flags,
xmlopt->config.priv,
.parseOpaque = parseOpaque,
};
+ if (parseFlags & VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE)
+ return 0;
+
/* this must be done before the hypervisor-specific callback,
* in case presence of a controller at a specific index is checked
*/
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9,
/* skip definition validation checks meant to be executed on define time only */
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 10,
+ /* skip post parse callback */
+ VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE = 1 << 11,
} virDomainDefParseFlags;
typedef enum {