From: Jason Dillaman Date: Thu, 1 Oct 2015 17:38:00 +0000 (-0400) Subject: common: added getter for retrieving all configuration keys X-Git-Tag: v10.0.1~103^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=038ed5233df1d488bfa31cf8b32ad4a4e0f7ea47;p=ceph.git common: added getter for retrieving all configuration keys Signed-off-by: Jason Dillaman --- diff --git a/src/common/config.cc b/src/common/config.cc index c26b8266fb22..ff5c7eacb027 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -811,6 +811,17 @@ int md_config_t::_get_val(const char *key, char **buf, int len) const return -ENOENT; } +void md_config_t::get_all_keys(std::vector *keys) const { + keys->clear(); + keys->reserve(NUM_CONFIG_OPTIONS); + for (size_t i = 0; i < NUM_CONFIG_OPTIONS; ++i) { + keys->push_back(config_optionsp[i].name); + } + for (int i = 0; i < subsys.get_num(); ++i) { + keys->push_back("debug_" + subsys.get_name(i)); + } +} + /* The order of the sections here is important. The first section in the * vector is the "highest priority" section; if we find it there, we'll stop * looking. The lowest priority section is the one we look in only if all diff --git a/src/common/config.h b/src/common/config.h index 41c999d73d03..262dc7153bae 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -140,6 +140,8 @@ public: int get_val(const char *key, char **buf, int len) const; int _get_val(const char *key, char **buf, int len) const; + void get_all_keys(std::vector *keys) const; + // Return a list of all the sections that the current entity is a member of. void get_my_sections(std::vector §ions) const;