]> xenbits.xensource.com Git - libvirt.git/commit
maint: improve VIR_ERR_INVALID_CONN usage
authorEric Blake <eblake@redhat.com>
Sat, 28 Dec 2013 03:31:17 +0000 (20:31 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 7 Jan 2014 04:41:02 +0000 (21:41 -0700)
commitdb3dd0824f03566ddf6e6eaa9c3a272ced2b618d
tree61b865a984225953af5cc52c3f7817d3dfe4cdde
parent7c98d1c153da5810ed4dcaa6be177df369b7d4bd
maint: improve VIR_ERR_INVALID_CONN usage

The datatype.c object checks could result in a message like:

error: invalid connection pointer in no connection

This consolidates all clients of this message to have uniform contents:

error: invalid connection pointer in someFunc

Note that virCheckConnectReturn raises an error immediately; in
datatypes.c, where we don't need to raise the error (but instead
just leave it in the thread-local setting), we use
virCheckConnectGoto and the cleanup label instead.  Then, for
consistency in that file, all subsequent error messages are
touched to also use the cleanup error label.

* src/datatypes.h (virCheckConnectReturn)
(virCheckConnectGoto): New macros.
* src/datatypes.c: Use new macro.
* src/libvirt-qemu.c (virDomainQemuAttach): Likewise.
(virLibConnError): Delete unused macro.
* src/libvirt-lxc.c (virLibConnError): Likewise.
* src/libvirt.c: Use new macro throughout.
* docs/api_extension.html.in: Modernize documentation.

Signed-off-by: Eric Blake <eblake@redhat.com>
docs/api_extension.html.in
src/datatypes.c
src/datatypes.h
src/libvirt-lxc.c
src/libvirt-qemu.c
src/libvirt.c