diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 6130f8a5307132ae0c0d61eae3d5a6970302bb0d..066be97f5395a3c45e8dc5454ecbe91435bfdaf4 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -105,17 +105,8 @@ int cpuMapLoad(const char *arch, goto cleanup; } - if ((xml = xmlParseFile(mapfile)) == NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse CPU map file: %s"), - mapfile); + if (!(xml = virXMLParseFileCtxt(mapfile, &ctxt))) goto cleanup; - } - - if ((ctxt = xmlXPathNewContext(xml)) == NULL) { - virReportOOMError(); - goto cleanup; - } virBufferAsprintf(&buf, "./arch[@name='%s']", arch); if (virBufferCheckError(&buf) < 0)