[libvirt] [PATCH 2/2] xml: Surpress printing "domain.xml" for parse errors on XML strings

Peter Krempa pkrempa at redhat.com
Tue Aug 16 12:49:23 UTC 2011


Patch a53ab1094e93f1b6d93ad9be63d8ccc5fd19a2a9 introduces printing
file name on XML errors. This corrects the URL string to be NULL and
therefrore to print an error message not containing bogus filename
"domain.xml".
---
 src/conf/domain_conf.c        |    2 +-
 src/security/virt-aa-helper.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ce1f3c5..35dc5fe 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7048,7 +7048,7 @@ virDomainDefParse(const char *xmlStr,
     xmlDocPtr xml;
     virDomainDefPtr def = NULL;

-    if ((xml = virXMLParse(filename, xmlStr, "domain.xml"))) {
+    if ((xml = virXMLParse(filename, xmlStr, NULL))) {
         def = virDomainDefParseNode(caps, xml, xmlDocGetRootElement(xml),
                                     expectedVirtTypes, flags);
         xmlFreeDoc(xml);
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 1e2feae..4781c7a 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -642,7 +642,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
     xmlXPathContextPtr ctxt = NULL;
     xmlNodePtr root;

-    if (!(xml = virXMLParseString(xmlStr, "domain.xml"))) {
+    if (!(xml = virXMLParseString(xmlStr, NULL))) {
         goto cleanup;
     }

-- 
1.7.3.4




More information about the libvir-list mailing list