diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6cb7156664..2e6a113de3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23563,17 +23563,14 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src, return true; error: - err = virSaveLastError(); + virErrorPreserveLast(&err); strSrc = virDomainDefFormat(src, NULL, 0); strDst = virDomainDefFormat(dst, NULL, 0); VIR_DEBUG("XMLs that failed stability check were: src=\"%s\", dst=\"%s\"", NULLSTR(strSrc), NULLSTR(strDst)); - if (err) { - virSetError(err); - virFreeError(err); - } + virErrorRestore(&err); return false; }