xml: report the filename (if any) when parsing files

A generic "failed to parse xml document" message without telling us
which XML file failed is quite unhelpful.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-08-16 13:08:52 +01:00
parent e6d7be38b9
commit 350e238f63

View File

@ -847,7 +847,8 @@ virXMLParseHelper(int domcode,
if (virGetLastErrorCode() == VIR_ERR_OK) {
virGenericReportError(domcode, VIR_ERR_XML_ERROR,
"%s", _("failed to parse xml document"));
_("failed to parse xml document '%s'"),
filename ? filename : "[inline data]");
}
goto cleanup;
}