virDomainDefPtr xenParseXL(virConfPtr conf, virCapsPtr caps, int xendConfigVersion) { virDomainDefPtr def = NULL; if (!(def = virDomainDefNew())) return NULL; def->virtType = VIR_DOMAIN_VIRT_XEN; def->id = -1; if (xenParseConfigCommon(conf, def, caps, xendConfigVersion) < 0) goto cleanup; if (xenParseXLOS(conf, def, caps) < 0) goto cleanup; if (xenParseXLDisk(conf, def) < 0) goto cleanup; if (xenParseXLSpice(conf, def) < 0) goto cleanup; if (xenParseXLInputDevs(conf, def) < 0) goto cleanup; return def; cleanup: virDomainDefFree(def); return NULL; }
/* * Convert an XM config record into a virDomainDef object. */ virDomainDefPtr xenParseXM(virConfPtr conf, virCapsPtr caps, virDomainXMLOptionPtr xmlopt) { virDomainDefPtr def = NULL; if (!(def = virDomainDefNew())) return NULL; def->virtType = VIR_DOMAIN_VIRT_XEN; def->id = -1; if (xenParseConfigCommon(conf, def, caps) < 0) goto cleanup; if (xenParseXMOS(conf, def) < 0) goto cleanup; if (xenParseXMDisk(conf, def) < 0) goto cleanup; if (xenParseXMInputDevs(conf, def) < 0) goto cleanup; if (virDomainDefPostParse(def, caps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, xmlopt) < 0) goto cleanup; return def; cleanup: virDomainDefFree(def); return NULL; }