summaryrefslogtreecommitdiffstats
path: root/src/common/options/build_options.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/common/options/build_options.cc
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/common/options/build_options.cc')
-rw-r--r--src/common/options/build_options.cc53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/common/options/build_options.cc b/src/common/options/build_options.cc
new file mode 100644
index 000000000..867fc2efd
--- /dev/null
+++ b/src/common/options/build_options.cc
@@ -0,0 +1,53 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#include "build_options.h"
+
+#include <algorithm>
+#include <cstring>
+
+std::vector<Option> get_global_options();
+std::vector<Option> get_mgr_options();
+std::vector<Option> get_mon_options();
+std::vector<Option> get_crimson_options();
+std::vector<Option> get_osd_options();
+std::vector<Option> get_rgw_options();
+std::vector<Option> get_rbd_options();
+std::vector<Option> get_rbd_mirror_options();
+std::vector<Option> get_immutable_object_cache_options();
+std::vector<Option> get_mds_options();
+std::vector<Option> get_mds_client_options();
+std::vector<Option> get_cephfs_mirror_options();
+std::vector<Option> get_ceph_exporter_options();
+
+std::vector<Option> build_options()
+{
+ std::vector<Option> result = get_global_options();
+
+ auto ingest = [&result](std::vector<Option>&& options, const char* svc) {
+ for (auto &o : options) {
+ if (std::none_of(o.services.begin(), o.services.end(),
+ [svc](const char* known_svc) {
+ return std::strcmp(known_svc, svc) == 0;
+ })) {
+ o.add_service(svc);
+ }
+ result.push_back(std::move(o));
+ }
+ };
+
+ ingest(get_crimson_options(), "osd");
+ ingest(get_mgr_options(), "mgr");
+ ingest(get_mon_options(), "mon");
+ ingest(get_osd_options(), "osd");
+ ingest(get_rgw_options(), "rgw");
+ ingest(get_rbd_options(), "rbd");
+ ingest(get_rbd_mirror_options(), "rbd-mirror");
+ ingest(get_immutable_object_cache_options(), "immutable-object-cache");
+ ingest(get_mds_options(), "mds");
+ ingest(get_mds_client_options(), "mds_client");
+ ingest(get_cephfs_mirror_options(), "cephfs-mirror");
+ ingest(get_ceph_exporter_options(), "ceph-exporter");
+
+ return result;
+}