[libvirt] Supressing error messages

Matthias Bolte matthias.bolte at googlemail.com
Fri Jan 15 21:14:29 UTC 2010

2010/1/15 Bryan Kearney <bkearney at redhat.com>:
> When using the java library, we are seeing libvirt error messages spit out..
> such as:
> libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock':
> No such file or directory
> Is there a means of supressing that logging via the api?
> -- bk


The default error callback prints this messages to stderr.

Use virSetErrorFunc to replace the default error callback with your
custom one. For example like this

static void
dummyErrorHandler(void *userData, virErrorPtr error) { }
virSetErrorFunc(NULL, dummyErrorHandler);


More information about the libvir-list mailing list