1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

logging: use the log cleaner

Actually use the log cleaner introduced by previous commit.

Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Oleg Vasilev 2023-01-30 21:00:02 +06:00 committed by Martin Kletzander
parent 69eeef5dfb
commit 515b24228f

View File

@ -21,6 +21,7 @@
#include <config.h>
#include "log_handler.h"
#include "log_cleaner.h"
#include "virerror.h"
#include "virfile.h"
#include "viralloc.h"
@ -175,7 +176,15 @@ virLogHandlerNew(bool privileged,
handler->inhibitor = inhibitor;
handler->opaque = opaque;
if (virLogCleanerInit(handler) < 0) {
goto error;
}
return handler;
error:
virObjectUnref(handler);
return NULL;
}
@ -313,6 +322,8 @@ virLogHandlerDispose(void *obj)
virLogHandler *handler = obj;
size_t i;
virLogCleanerShutdown(handler);
for (i = 0; i < handler->nfiles; i++) {
handler->inhibitor(false, handler->opaque);
virLogHandlerLogFileFree(handler->files[i]);