[libvirt] [PATCH 3/3] all: replacing virGetLastError with virGetLastErrorCode where we can

2018-05-05 Thread ramyelkest
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|

[libvirt] [PATCH 2/3] util: added virGetLastErrorCode/Domain

2018-05-05 Thread ramyelkest
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

[libvirt] [PATCH 1/3] util: cleanup: using virGetLastErrorMessage instead of err->message

2018-05-05 Thread ramyelkest
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

[libvirt] [PATCH v2 0/3] adding virGetLastErrorCode/Domain to paritally replace virGetLastError

2018-05-05 Thread ramyelkest
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

[libvirt] [PATCH 1/2] util: adding virHasLastError and virGetLastErrorCode/Domain

2018-05-03 Thread ramyelkest
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

[libvirt] [PATCH 2/2] all: replacing virGetLastError with virHas/GetLastErrorCode/Domain

2018-05-03 Thread ramyelkest
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

[libvirt] [PATCH 0/2] adding virHas/GetLastErrorCode/Domain to paritally replace virGetLastError

2018-05-03 Thread ramyelkest
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