]> xenbits.xensource.com Git - libvirt.git/commit
maint: move debug statements first in public API
authorEric Blake <eblake@redhat.com>
Fri, 27 Dec 2013 21:16:56 +0000 (14:16 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 3 Jan 2014 13:15:04 +0000 (06:15 -0700)
commitff65843480ef78bf50d274123d6fb9d679eee27e
treefef63405043f012d179e35f0aa46464c6fcfa457
parent13f837200792364b90ebdff8b47e13569a06997c
maint: move debug statements first in public API

Most of our public APIs emit a debug log on entry, prior to anything
else.  There were a few exceptions where obvious failures were not
logged, so fix those.  When moving a debug earlier, this patch also
makes sure to avoid any NULL dereference during the log (the APIs
are supposed to gracefully fail if the user passes NULL for the object).

However, do NOT use VIR_DEBUG prior to virInitialize, since setting
up the error reporting can change where VIR_DEBUG output would be
routed.  Instead add documentation to virGlobalInit, virInitialize,
and virGetVersion that better explains initialization.

* src/libvirt.c (virGetVersion, virConnectRef, virDomainRef)
(virNetworkRef, virInterfaceRef, virStoragePoolRef)
(virStorageVolRef, virNodeDeviceRef, virSecretRef, virStreamRef)
(virNWFilterRef, virDomainSnapshotRef): Debug on function entry.
* src/libvirt-lxc.c (virDomainLxcEnterNamespace)
(virDomainLxcEnterSecurityLabel): Likewise.

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