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: NRamy Elkest <ramyelkest@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
Showing
想要评论请 注册 或 登录