This patch is part of the bite sized task, Share duplicated daemon code. A new function is introduced for shared code in *SetupLogging functions. Commit 1: Share Dup Daemon Function *SetupLogging Introduce src/util/virdaemon.c/h files. Introduce new function virDaemonSetupLogging for shared code in *SetupLogging. Convert all callers of *SetupLogging functions to virDaemonSetupLogging. Introduce new struct virDaemonLogConfig for log configs (log_*) in *DeamonConfig structs. *DeamonConfig is an input to virDaemonSetupLogging. Commit 2: Alloc and Free virDaemonLogConfig Introduce functions to alloc and free the new struct virDaemonLogConfig. Commit 3: Passing virDaemonLogConfig to DaemonSetupLogging Convert all the callers that now pass virDaemonLogConfig to the new function virDaemonSetupLogging. Lan (3): Share Dup Daemon Function *SetupLogging Alloc and Free virDaemonLogConfig Passing virDaemonLogConfig to DaemonSetupLogging src/libvirt_private.syms | 4 ++ src/locking/lock_daemon.c | 66 +++++------------------- src/logging/log_daemon.c | 58 +++++---------------- src/remote/remote_daemon.c | 65 +++++------------------- src/util/Makefile.inc.am | 2 + src/util/virdaemon.c | 101 +++++++++++++++++++++++++++++++++++++ src/util/virdaemon.h | 43 ++++++++++++++++ 7 files changed, 186 insertions(+), 153 deletions(-) create mode 100644 src/util/virdaemon.c create mode 100644 src/util/virdaemon.h -- 2.17.1