1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

Fix duplicating logging of errors in libvirtd

The libvirt default error handling callback will print all errors
to stderr. The libvirtd default logging callback will do the same.
Set a no-op error handling callback in libvirtd to prevent this
duplication

* daemon/libvirtd.c: Register a no-op error handling function
This commit is contained in:
Daniel P. Berrange 2009-10-19 18:28:28 +01:00
parent 5f67253813
commit 4ab7995871

View File

@ -776,6 +776,12 @@ static int qemudInitPaths(struct qemud_server *server,
return ret;
}
static void virshErrorHandler(void *opaque ATTRIBUTE_UNUSED, virErrorPtr err ATTRIBUTE_UNUSED)
{
/* Don't do anything, since logging infrastructure already
* took care of reporting the error */
}
static struct qemud_server *qemudInitialize(int sigread) {
struct qemud_server *server;
@ -2995,6 +3001,9 @@ int main(int argc, char **argv) {
if (remoteReadConfigFile (server, remote_config_file) < 0)
goto error2;
/* Disable error func, now logging is setup */
virSetErrorFunc(NULL, virshErrorHandler);
if (virEventAddHandleImpl(sigpipe[0],
VIR_EVENT_HANDLE_READABLE,
qemudDispatchSignalEvent,