From: Jiri Denemark Date: Fri, 13 May 2016 16:27:09 +0000 (+0200) Subject: cpu: Properly report errors when parsing CPU map XML X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5b62a951767d809b2c7bd37c0efd65021bc9c4bf;p=libvirt.git cpu: Properly report errors when parsing CPU map XML Signed-off-by: Jiri Denemark --- diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 6130f8a530..066be97f53 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)