src/domain_conf.c: Check the last error, not the last

connection error, which may not have been set.
This commit is contained in:
John Levon 2009-02-05 19:29:37 +00:00
parent 003f354917
commit 31135bff29
2 changed files with 8 additions and 4 deletions

View File

@ -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

View 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;