all: Replace virGetLastError with virGetLastErrorCode where we can

Replace instances where we previously called virGetLastError just to
either get the code or to check if an error exists with
virGetLastErrorCode to avoid a validity pre-check.

Signed-off-by: Ramy Elkest <ramyelkest@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
ramyelkest
2018-05-05 13:04:21 +01:00
committed by Erik Skultety
parent 50e96bb2a1
commit 2b6667abbf
24 changed files with 39 additions and 55 deletions

View File

@@ -49,7 +49,7 @@ linuxTestCompareFiles(const char *cpuinfofile,
&nodeinfo.nodes, &nodeinfo.sockets,
&nodeinfo.cores, &nodeinfo.threads) < 0) {
if (virTestGetDebug()) {
if (virGetLastError())
if (virGetLastErrorCode())
VIR_TEST_DEBUG("\n%s\n", virGetLastErrorMessage());
}
VIR_FORCE_FCLOSE(cpuinfo);