[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v2 8/8] 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.

Signed-off-by: Daniel P. Berrangé <berrange redhat com>
---
 src/util/virxml.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/virxml.c b/src/util/virxml.c
index a03a747e60..d1926f4605 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -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;
 }
-- 
2.17.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]