提交 31135bff 编写于 作者: J John Levon

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

        connection error, which may not have been set.
上级 003f3549
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
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册