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>
#include <config.h>
#include "log_handler.h"
+#include "log_cleaner.h"
#include "virerror.h"
#include "virfile.h"
#include "viralloc.h"
handler->inhibitor = inhibitor;
handler->opaque = opaque;
+ if (virLogCleanerInit(handler) < 0) {
+ goto error;
+ }
+
return handler;
+
+ error:
+ virObjectUnref(handler);
+ return NULL;
}
virLogHandler *handler = obj;
size_t i;
+ virLogCleanerShutdown(handler);
+
for (i = 0; i < handler->nfiles; i++) {
handler->inhibitor(false, handler->opaque);
virLogHandlerLogFileFree(handler->files[i]);