diff --git a/src/cmds.cc b/src/cmds.cc index 04bfd852c91..a561792569b 100644 --- a/src/cmds.cc +++ b/src/cmds.cc @@ -170,7 +170,10 @@ int main(int argc, const char **argv) } dout(0) << "requesting oneshot_replay for mds" << r << dendl; shadow = MDSMap::STATE_ONESHOT_REPLAY; - g_conf->mds_standby_for_rank = r; + char rb[32]; + snprintf(rb, sizeof(rb), "%d", r); + g_conf->set_val("mds_standby_for_rank", rb); + g_conf->apply_changes(NULL); } else if (ceph_argparse_witharg(args, i, &val, "--hot-standby", (char*)NULL)) { int r = parse_rank("hot-standby", val); @@ -180,7 +183,10 @@ int main(int argc, const char **argv) } dout(0) << "requesting standby_replay for mds" << r << dendl; shadow = MDSMap::STATE_STANDBY_REPLAY; - g_conf->mds_standby_for_rank = r; + char rb[32]; + snprintf(rb, sizeof(rb), "%d", r); + g_conf->set_val("mds_standby_for_rank", rb); + g_conf->apply_changes(NULL); } else { derr << "Error: can't understand argument: " << *i << "\n" << dendl; diff --git a/src/common/config.h b/src/common/config.h index 8419cfca16b..e946e951bae 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -157,7 +157,7 @@ private: public: EntityName name; -#define OPTION_OPT_INT(name) int name; +#define OPTION_OPT_INT(name) const int name; #define OPTION_OPT_LONGLONG(name) long long name; #define OPTION_OPT_STR(name) std::string name; #define OPTION_OPT_DOUBLE(name) double name; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index cf76362a8af..a7a93c692dc 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6151,10 +6151,14 @@ void MDCache::shutdown_check() dout(0) << "shutdown_check at " << ceph_clock_now(g_ceph_context) << dendl; // cache - int o = g_conf->debug_mds; - g_conf->debug_mds = 10; + char old_val[32] = { 0 }; + char *o = old_val; + g_conf->get_val("debug_mds", &o, sizeof(old_val)); + g_conf->set_val("debug_mds", "10"); + g_conf->apply_changes(NULL); show_cache(); - g_conf->debug_mds = o; + g_conf->set_val("debug_mds", old_val); + g_conf->apply_changes(NULL); mds->timer.add_event_after(g_conf->mds_shutdown_check, new C_MDC_ShutdownCheck(this)); // this diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index b1d14d2e4b9..9c82db99587 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -32,7 +32,7 @@ int librgw_create(librgw_t *rgw, const char * const id) iparams.name.set(CEPH_ENTITY_TYPE_CLIENT, id); } CephContext *cct = common_preinit(iparams, CODE_ENVIRONMENT_LIBRARY, 0); - cct->_conf->log_to_stderr = 1; // quiet by default + cct->_conf->set_val("log_to_stderr", "1"); // quiet by default cct->_conf->parse_env(); // environment variables override cct->_conf->apply_changes(NULL); diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 641c89be2bf..42fa61af9c5 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1501,9 +1501,12 @@ int RGWHandler::init(struct req_state *_s, FCGX_Request *fcgx) RGWConf *conf = s->env->conf; - if (conf->log_level >= 0) - g_conf->rgw_log = conf->log_level; - + if (conf->log_level >= 0) { + char buf[32]; + snprintf(buf, sizeof(buf), "%d", conf->log_level); + g_conf->set_val("rgw_log", buf); + g_conf->apply_changes(NULL); + } if (g_conf->rgw_log >= 20) { char *p; for (int i=0; (p = fcgx->envp[i]); ++i) { diff --git a/src/test/store_test.cc b/src/test/store_test.cc index f4fc7eb4db5..4ddb042c587 100644 --- a/src/test/store_test.cc +++ b/src/test/store_test.cc @@ -527,7 +527,8 @@ int main(int argc, char **argv) { global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0); common_init_finish(g_ceph_context); - g_ceph_context->_conf->osd_journal_size = 400; + g_ceph_context->_conf->set_val("osd_journal_size", "400"); + g_ceph_context->_conf->apply_changes(NULL); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS();