From: Sage Weil Date: Sat, 17 Nov 2018 12:50:17 +0000 (-0600) Subject: mon/MonClient: add callback for (any) config change X-Git-Tag: v14.1.0~875^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14d26adf7563beda7f04a06c8d72b8fd226e4199;p=ceph.git mon/MonClient: add callback for (any) config change This is a coarse "there was some config update". It's fired whether or not it values are observed. Signed-off-by: Sage Weil --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index e78cd9d0420e..b408f95c5d40 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -374,6 +374,9 @@ void MonClient::handle_config(MConfig *m) ldout(cct,10) << __func__ << " " << *m << dendl; finisher.queue(new FunctionContext([this, m](int r) { cct->_conf.set_mon_vals(cct, m->config, config_cb); + if (config_notify_cb) { + config_notify_cb(); + } m->put(); })); got_config = true; diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index 4d0755c14697..b16a7f22f1aa 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -439,6 +439,9 @@ public: } void register_config_callback(md_config_t::config_callback fn); + void register_config_notify_callback(std::function f) { + config_notify_cb = f; + } md_config_t::config_callback get_config_callback(); private: @@ -453,6 +456,7 @@ private: void handle_get_version_reply(MMonGetVersionReply* m); md_config_t::config_callback config_cb; + std::function config_notify_cb; }; #endif