ret = testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, xml_in,
info->different ? xml_out : xml_in,
- false);
+ false,
+ NULL, NULL);
cleanup:
VIR_FREE(xml_in);
ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
info->different ? xml_out : xml_in,
- !info->inactive_only);
+ !info->inactive_only,
+ NULL, NULL);
cleanup:
VIR_FREE(xml_in);
VIR_FREE(xml_out);
ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
info->different ? xml_out : xml_in,
- !info->inactive_only);
+ !info->inactive_only,
+ NULL, NULL);
cleanup:
VIR_FREE(xml_in);
VIR_FREE(xml_out);
const struct testInfo *info = opaque;
return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt,
- info->inName, info->outActiveName, true);
+ info->inName, info->outActiveName, true,
+ NULL, NULL);
}
const struct testInfo *info = opaque;
return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->inName,
- info->outInactiveName, false);
+ info->outInactiveName, false,
+ NULL, NULL);
}
int
testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
- const char *infile, const char *outfile, bool live)
+ const char *infile, const char *outfile, bool live,
+ testCompareDomXML2XMLPreFormatCallback cb,
+ const void *opaque)
{
char *actual = NULL;
int ret = -1;
goto fail;
}
+ if (cb && cb(def, opaque) < 0)
+ goto fail;
+
if (!(actual = virDomainDefFormat(def, caps, format_flags)))
goto fail;
virCapsPtr virTestGenericCapsInit(void);
virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void);
+typedef int (*testCompareDomXML2XMLPreFormatCallback)(virDomainDefPtr def,
+ const void *opaque);
int testCompareDomXML2XMLFiles(virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
const char *inxml,
const char *outfile,
- bool live);
+ bool live,
+ testCompareDomXML2XMLPreFormatCallback cb,
+ const void *opaque);
#endif /* __VIT_TEST_UTILS_H__ */