From 6c4d76ca0c595af0eb01ffaa9db0a17c49b25f7d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 18 Jun 2018 07:01:24 -0500 Subject: [PATCH] common/options: dump flags Also document. Signed-off-by: Sage Weil --- doc/dev/config.rst | 9 +++++++++ src/common/options.cc | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/doc/dev/config.rst b/doc/dev/config.rst index fbc4a5d5660..40d2d6f7a08 100644 --- a/doc/dev/config.rst +++ b/doc/dev/config.rst @@ -155,3 +155,12 @@ Enums For options with a defined set of allowed values:: .set_enum_allowed({"none", "crc32c", "crc32c_16", "crc32c_8", "xxhash32", "xxhash64"}) + +Flags +----- + +* **RUNTIME**: the value can be updated at runtime +* **NO_MON_UPDATE**: Daemons/clients do not pull this value from the monitor config database. We disallow setting this option via 'ceph config set ...'. This option should be configured via ceph.conf or via the command line. +* **STARTUP**: option takes effect only during daemon startup +* **CLUSTER_CREATE**: option only affects cluster creation +* **CREATE**: option only affects daemon creation diff --git a/src/common/options.cc b/src/common/options.cc index fc7df3b4df8..73eac3e27fb 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -319,6 +319,24 @@ void Option::dump(Formatter *f) const dump_value("max", max, f); f->dump_bool("can_update_at_runtime", can_update_at_runtime()); + + f->open_array_section("flags"); + if (has_flag(FLAG_RUNTIME)) { + f->dump_string("option", "runtime"); + } + if (has_flag(FLAG_NO_MON_UPDATE)) { + f->dump_string("option", "no_mon_update"); + } + if (has_flag(FLAG_STARTUP)) { + f->dump_string("option", "startup"); + } + if (has_flag(FLAG_CLUSTER_CREATE)) { + f->dump_string("option", "cluster_create"); + } + if (has_flag(FLAG_CREATE)) { + f->dump_string("option", "create"); + } + f->close_section(); } std::string Option::to_str(const Option::value_t& v) -- 2.39.5