From 673f22159d0904e6ca07a047c19e065d8df6d4d2 Mon Sep 17 00:00:00 2001 From: Oleg Vasilev Date: Mon, 30 Jan 2023 20:59:59 +0600 Subject: [PATCH] logging: move virLogHandler to header Signed-off-by: Oleg Vasilev Reviewed-by: Martin Kletzander --- src/logging/log_handler.c | 26 -------------------------- src/logging/log_handler.h | 29 +++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 7342404b00..8fc7e9b2a8 100644 --- a/src/logging/log_handler.c +++ b/src/logging/log_handler.c @@ -22,11 +22,9 @@ #include "log_handler.h" #include "virerror.h" -#include "virobject.h" #include "virfile.h" #include "viralloc.h" #include "virlog.h" -#include "virrotatingfile.h" #include "viruuid.h" #include "virutil.h" @@ -42,30 +40,6 @@ VIR_LOG_INIT("logging.log_handler"); #define DEFAULT_MODE 0600 -typedef struct _virLogHandlerLogFile virLogHandlerLogFile; -struct _virLogHandlerLogFile { - virRotatingFileWriter *file; - int watch; - int pipefd; /* Read from QEMU via this */ - bool drained; - - char *driver; - unsigned char domuuid[VIR_UUID_BUFLEN]; - char *domname; -}; - -struct _virLogHandler { - virObjectLockable parent; - - bool privileged; - virLogDaemonConfig *config; - - virLogHandlerLogFile **files; - size_t nfiles; - - virLogHandlerShutdownInhibitor inhibitor; - void *opaque; -}; static virClass *virLogHandlerClass; static void virLogHandlerDispose(void *obj); diff --git a/src/logging/log_handler.h b/src/logging/log_handler.h index c9af033cd3..d473a19fc6 100644 --- a/src/logging/log_handler.h +++ b/src/logging/log_handler.h @@ -23,12 +23,37 @@ #include "internal.h" #include "virjson.h" #include "log_daemon_config.h" +#include "virobject.h" +#include "virrotatingfile.h" + +typedef void (*virLogHandlerShutdownInhibitor)(bool inhibit, + void *opaque); + +typedef struct _virLogHandlerLogFile virLogHandlerLogFile; +struct _virLogHandlerLogFile { + virRotatingFileWriter *file; + int watch; + int pipefd; /* Read from QEMU via this */ + bool drained; + + char *driver; + unsigned char domuuid[VIR_UUID_BUFLEN]; + char *domname; +}; typedef struct _virLogHandler virLogHandler; +struct _virLogHandler { + virObjectLockable parent; + bool privileged; + virLogDaemonConfig *config; -typedef void (*virLogHandlerShutdownInhibitor)(bool inhibit, - void *opaque); + virLogHandlerLogFile **files; + size_t nfiles; + + virLogHandlerShutdownInhibitor inhibitor; + void *opaque; +}; virLogHandler *virLogHandlerNew(bool privileged, virLogDaemonConfig *config, -- 2.39.5