This patch adds a generic API for drivers to log warning / debug / info
messages. The existing error APIs are not suitable for this purpose since
each time you set an error, it clears the previous one. This adds a public
API virSetLogFunc allowing applications to register a callback to receive
log messages. If none is registered, they are sent to the big void. It
adapts the QEMU driver to use this logging API instead of qemudLog and
qemudDebug(). It makes the qemud/qemud.c file register a logging callback
to receive the messages & send them onto syslog/stderr as needed.
There are other drivers (in particular src/xm_internal.c) where this
logging API will be useful too. I've not attempted to make them use it
yet though.
include/libvirt/virterror.h | 24 ++++++++++++++++++
qemud/conf.c | 46 ++++++++++++++++++------------------
qemud/driver.c | 56 ++++++++++++++++++++++----------------------
qemud/iptables.c | 8 +++---
qemud/qemud.c | 36 ++++++++++++++++++++++++++++
qemud/uuid.c | 9 +++----
src/internal.h | 5 +++
src/libvirt_sym.version | 1
src/virterror.c | 28 ++++++++++++++++++++++
9 files changed, 155 insertions(+), 58 deletions(-)
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|