]> git.ipfire.org Git - thirdparty/libvirt.git/commit
maint: improve VIR_ERR_INVALID_NETWORK usage
authorEric Blake <eblake@redhat.com>
Fri, 27 Dec 2013 23:52:40 +0000 (16:52 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 8 Jan 2014 16:38:27 +0000 (09:38 -0700)
commite176159374b3ea15df91e8487d8c6d6396dd5f11
tree0c0c135fd5b164212ceec15aa4baf34209462500
parent6f9894856c8c880d94f8cedf761f45aaeece2a8a
maint: improve VIR_ERR_INVALID_NETWORK usage

When checking for a valid network, we weren't consistent on
whether we reported an invalid network or a connection.  Similar
to previous patches such as commit 6e130ddc, the difference
between VIR_IS_NETWORK and VIR_IS_CONNECTED_NETWORK is moot (due
to reference counting, any valid network must be tied to a valid
connection).  Use a common macro to make the error reporting
for invalid networks nicer.

* src/datatypes.h (virCheckNetworkReturn, virCheckNetworkGoto): New
macros.
(VIR_IS_NETWORK, VIR_IS_CONNECTED_NETWORK): Drop unused macros.
* src/libvirt.c: Use macro throughout.
(virLibNetworkError): Drop unused macro.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/datatypes.h
src/libvirt.c