1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

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-13 18:27:09 +02:00
parent 17924643ec
commit 5b62a95176

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)