]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: added getter for retrieving all configuration keys
authorJason Dillaman <dillaman@redhat.com>
Thu, 1 Oct 2015 17:38:00 +0000 (13:38 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 5 Nov 2015 21:12:41 +0000 (16:12 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/common/config.cc
src/common/config.h

index c26b8266fb2249cc6442c47e0a85fb2d38303ab1..ff5c7eacb027120e883f7aa9e7815e74ba182af6 100644 (file)
@@ -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<std::string> *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
index 41c999d73d0339b650a8f8efb3266d41ad48cd37..262dc7153bae6a315f4972910168ec84742fa75d 100644 (file)
@@ -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<std::string> *keys) const;
+
   // Return a list of all the sections that the current entity is a member of.
   void get_my_sections(std::vector <std::string> &sections) const;