cpu: Properly report errors when parsing CPU map XML

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark
2016-05-16 15:46:30 +02:00
parent 17924643ec
commit 5b62a95176
+1 -10
View File
@@ -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)