]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add flags argument to common_init_finish 1011/head
authorLoic Dachary <loic@dachary.org>
Sun, 29 Dec 2013 11:26:14 +0000 (12:26 +0100)
committerLoic Dachary <loic@dachary.org>
Tue, 31 Dec 2013 12:47:44 +0000 (13:47 +0100)
It is the same flag that is given to common_preinit. The service thread
is not initialized if CINIT_FLAG_NO_DAEMON_ACTIONS is set.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph_mon.cc
src/common/common_init.cc
src/common/common_init.h

index 863bce38b8a5eb319a825ca4be30cc68c13f7d69..28b9b15033302061b254c40c4837567f1bad5d6c 100644 (file)
@@ -213,7 +213,7 @@ int main(int argc, const char **argv)
     // resolve public_network -> public_addr
     pick_addresses(g_ceph_context, CEPH_PICK_ADDRESS_PUBLIC);
 
-    common_init_finish(g_ceph_context);
+    common_init_finish(g_ceph_context, flags);
 
     bufferlist monmapbl, osdmapbl;
     std::string error;
index 8fb688cd8d3faa9052e98c9e31d4c53865c2b544..6538b18ab2df47232156deaa9ef90c0625329016 100644 (file)
@@ -112,10 +112,12 @@ void complain_about_parse_errors(CephContext *cct,
 
 /* Please be sure that this can safely be called multiple times by the
  * same application. */
-void common_init_finish(CephContext *cct)
+void common_init_finish(CephContext *cct, int flags)
 {
   ceph::crypto::init(cct);
-  cct->start_service_thread();
+
+  if (!(flags & CINIT_FLAG_NO_DAEMON_ACTIONS))
+    cct->start_service_thread();
 
   if (cct->_conf->lockdep) {
     g_lockdep = true;
index f48b349bf0011b4218614fce3b239090b6bbdcb7..d6aa9fa32c1b5465254bdef9a86215a92e9057b2 100644 (file)
@@ -75,6 +75,6 @@ void complain_about_parse_errors(CephContext *cct,
  * libraries. The most obvious reason for this is that the threads started by
  * the Ceph libraries would be destroyed by a fork().
  */
-void common_init_finish(CephContext *cct);
+void common_init_finish(CephContext *cct, int flags = 0);
 
 #endif