mirror of https://gitee.com/openkylin/libvirt.git
conf: Use consistent error preservation and restoration calls
Provide some consistency over error message variable name and usage when saving error messages across possible other errors or possibility of resetting of the last error. Instead of virSaveLastError paired up with virSetError and virFreeError, we should use the newer virErrorPreserveLast and virRestoreError. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
382c762c45
commit
4e7b3b1ebd
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue