]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src/domain_conf.c: Check the last error, not the last
authorJohn Levon <john.levon@sun.com>
Thu, 5 Feb 2009 19:29:37 +0000 (19:29 +0000)
committerJohn Levon <john.levon@sun.com>
Thu, 5 Feb 2009 19:29:37 +0000 (19:29 +0000)
        connection error, which may not have been set.

ChangeLog
src/domain_conf.c

index d08fb22a5d5b9ba00cfe39c361854537a7fd6f0c..d27f6fe38e6c9ae62e0ac5b23206620150683294 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Feb  5 19:28:10 GMT 2009 John Levon <john.levon@sun.com>
+
+       * src/domain_conf.c: Check the last error, not the last
+       connection error, which may not have been set.
+
 Thu Feb  5 18:08:39 GMT 2009 John Levon <john.levon@sun.com>
 
        * src/xs_internal.c: Use virMacAddrCompare() for
index c149af5c60710fa5366e63c393518cd6f2b65db0..e46bf43b28a57905145d33a9a09f779bcc99e614 100644 (file)
@@ -2424,8 +2424,7 @@ catchXMLError (void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
     if (ctxt) {
         virConnectPtr conn = ctxt->_private;
 
-        if (conn &&
-            conn->err.code == VIR_ERR_NONE &&
+        if (virGetLastError() == NULL &&
             ctxt->lastError.level == XML_ERR_FATAL &&
             ctxt->lastError.message != NULL) {
             virDomainReportError (conn, VIR_ERR_XML_DETAIL,
@@ -2458,7 +2457,7 @@ virDomainDefPtr virDomainDefParseString(virConnectPtr conn,
                           XML_PARSE_NOENT | XML_PARSE_NONET |
                           XML_PARSE_NOWARNING);
     if (!xml) {
-        if (conn && conn->err.code == VIR_ERR_NONE)
+        if (virGetLastError() == NULL)
               virDomainReportError(conn, VIR_ERR_XML_ERROR,
                                    "%s", _("failed to parse xml document"));
         goto cleanup;
@@ -2499,7 +2498,7 @@ virDomainDefPtr virDomainDefParseFile(virConnectPtr conn,
                            XML_PARSE_NOENT | XML_PARSE_NONET |
                            XML_PARSE_NOWARNING);
     if (!xml) {
-        if (conn && conn->err.code == VIR_ERR_NONE)
+        if (virGetLastError() == NULL)
               virDomainReportError(conn, VIR_ERR_XML_ERROR,
                                    "%s", _("failed to parse xml document"));
         goto cleanup;