{
g_autoptr(xmlDoc) xml = NULL;
g_autoptr(xmlXPathContext) ctxt = NULL;
+ bool validate = flags & VIR_VOL_XML_PARSE_VALIDATE;
if (!(xml = virXMLParse(filename, xmlStr, _("(storage_volume_definition)"),
- "volume", &ctxt, NULL, false)))
+ "volume", &ctxt, "storagevol.rng", validate)))
return NULL;
return virStorageVolDefParseXML(pool, ctxt, flags);
VIR_VOL_XML_PARSE_NO_CAPACITY = 1 << 0,
/* do not require volume capacity if the volume has a backing store */
VIR_VOL_XML_PARSE_OPT_CAPACITY = 1 << 1,
+ /* validate the XML against the RNG schema */
+ VIR_VOL_XML_PARSE_VALIDATE = 1 << 2,
} virStorageVolDefParseFlags;
virStorageVolDef *