Replaced instances where we 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
---
src/locking/lock_driver_lockd.c | 3 +--
src/lxc/lxc_controller.c|
Many places in the code call virGetLastError() just to check the
raised error code, or domain. However virGetLastError() can return
NULL, so the code has to check for that first. This patch therefore
introduces virGetLasErrorCode/Domain function which always returns a
valid error code/domain
Signed-off-by: Ramy Elkest
---
src/util/virfilecache.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c
index dab7216..96ae96d 100644
--- a/src/util/virfilecache.c
+++ b/src/util/virfilecache.c
@@ -157,9
Changes from v1[1]:
* removed virHasLastError() and s/virHasLastError/virGetLastErrorCode/g
* replaced in missed files: virmodule.c and virnetlibsshsession.c
* better split of patches
[1] https://www.redhat.com/archives/libvir-list/2018-May/msg00259.html
ramyelkest (3):
util: cleanup: using
Many places in the code call virGetLastError() just to check the
raised error code, or domain. However virGetLastError() can return
NULL, so the code has to check for that as well.
So Instead we create functions virGetLastErrorCode and virGetLastErrorDomain
(in addition to the existing
Many places in the code call virGetLastError() just to check the
raised error code, or domain. However virGetLastError() can return
NULL, so the code has to check for that as well.
So Instead we create functions virGetLastErrorCode and virGetLastErrorDomain
(in addition to the existing
it if needed
Signed-off-by: Ramy Elkest <ramyelk...@gmail.com>
ramyelkest (2):
util: adding virHasLastError and virGetLastErrorCode/Domain
all: replacing virGetLastError with virHas/GetLastErrorCode/Domain
include/libvirt/virterror.h | 3 ++
src/libvirt_public.syms