static int parallelsDiskDescParse(const char *path, virStorageVolDefPtr def) { xmlDocPtr xml; int ret = -1; if (!(xml = virXMLParse(path, NULL, NULL))) return -1; ret = parallelsDiskDescParseNode(xml, xmlDocGetRootElement(xml), def); xmlFreeDoc(xml); return ret; }
static virInterfaceDefPtr virInterfaceDefParse(const char *xmlStr, const char *filename) { xmlDocPtr xml; virInterfaceDefPtr def = NULL; if ((xml = virXMLParse(filename, xmlStr, _("(interface_definition)")))) { def = virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml)); xmlFreeDoc(xml); } return def; }
static virSecretDefPtr virSecretDefParse(const char *xmlStr, const char *filename) { xmlDocPtr xml; virSecretDefPtr ret = NULL; if ((xml = virXMLParse(filename, xmlStr, _("(definition_of_secret)")))) { ret = secretXMLParseNode(xml, xmlDocGetRootElement(xml)); xmlFreeDoc(xml); } return ret; }
static virNodeDeviceDefPtr virNodeDeviceDefParse(const char *str, const char *filename, int create) { xmlDocPtr xml; virNodeDeviceDefPtr def = NULL; if ((xml = virXMLParse(filename, str, "device.xml"))) { def = virNodeDeviceDefParseNode(xml, xmlDocGetRootElement(xml), create); xmlFreeDoc(xml); } return def; }
virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr, virCapsPtr caps, virDomainXMLOptionPtr xmlopt, unsigned int expectedVirtTypes, unsigned int flags) { virDomainSnapshotDefPtr ret = NULL; xmlDocPtr xml; int keepBlanksDefault = xmlKeepBlanksDefault(0); if ((xml = virXMLParse(NULL, xmlStr, _("(domain_snapshot)")))) { xmlKeepBlanksDefault(keepBlanksDefault); ret = virDomainSnapshotDefParseNode(xml, xmlDocGetRootElement(xml), caps, xmlopt, expectedVirtTypes, flags); xmlFreeDoc(xml); } xmlKeepBlanksDefault(keepBlanksDefault); return ret; }