]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: virerror: Introduce virGetLastError{Code,Domain} public APIs
authorramyelkest <ramyelkest@gmail.com>
Sat, 5 May 2018 12:04:20 +0000 (13:04 +0100)
committerErik Skultety <eskultet@redhat.com>
Tue, 5 Jun 2018 16:44:05 +0000 (18:44 +0200)
commit50e96bb2a18a1bd7c2e7c5585e4ba60759496121
tree518027c51eddabf99ea8061605668cd277f22b19
parent52d88d11db833c6737b6f1d91c707023c8a87f44
util: virerror: Introduce virGetLastError{Code,Domain} public APIs

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 virGetLasError{Code,Domain} functions which always return a
valid error code or domain respectively, thus dropping the need to
perform any checks on the error object.

Signed-off-by: Ramy Elkest <ramyelkest@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
include/libvirt/virterror.h
src/libvirt_public.syms
src/util/virerror.c