]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: add ConfigProxy::parse_argv()
authorKefu Chai <kchai@redhat.com>
Sat, 16 Mar 2019 02:47:20 +0000 (10:47 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 20 Mar 2019 06:01:42 +0000 (14:01 +0800)
it's only used by crimson-osd for parsing ceph options.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/config_proxy.h

index 46690009cb64f25f040bfaac2f54b91826713594..0e6dae72991ae557b8f4a547a929ea05850aa109 100644 (file)
@@ -147,6 +147,20 @@ public:
     });
   }
 
+  seastar::future<> parse_argv(std::vector<const char*>& argv) {
+    // we could pass whatever is unparsed to seastar, but seastar::app_template
+    // is used for driving the seastar application, and
+    // ceph::common::ConfigProxy is not available until seastar engine is up
+    // and running, so we have to feed the command line args to app_template
+    // first, then pass them to ConfigProxy.
+    return do_change([&argv, this](ConfigValues& values) {
+      get_config().parse_argv(values,
+                             obs_mgr,
+                             argv,
+                             CONF_CMDLINE);
+    });
+  }
+
   seastar::future<> parse_config_files(const std::string& conf_files) {
     return do_change([this, conf_files](ConfigValues& values) {
       const char* conf_file_paths =