Merge pull request #27352 from liewegas/wip-deferred-log-start

common: start logging for non-global_init users

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-04-08 19:49:11 +08:00 committed by GitHub
commit fcca032bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -106,6 +106,10 @@ void common_init_finish(CephContext *cct)
cct->init_crypto();
ZTracer::ztrace_init();
if (!cct->_log->is_started()) {
cct->_log->start();
}
int flags = cct->get_init_flags();
if (!(flags & CINIT_FLAG_NO_DAEMON_ACTIONS))
cct->start_service_thread();

View File

@ -77,8 +77,6 @@ public:
int init()
{
common_init_finish(cct);
int ret;
{
@ -88,6 +86,8 @@ public:
return ret;
}
common_init_finish(cct);
//monmap
monclient = new MonClient(cct);
ret = -CEPHFS_ERROR_MON_MAP_BUILD; //defined in libcephfs.h;

View File

@ -82,6 +82,8 @@ class Log : private Thread
void _log_message(const char *s, bool crash);
public:
using Thread::is_started;
Log(const SubsystemMap *s);
~Log() override;