From: Sage Weil Date: Thu, 18 Jan 2018 18:47:51 +0000 (-0600) Subject: common/options,librbd/Utils: refactor RBD feature validation X-Git-Tag: v13.0.2~456^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F20014%2Fhead;p=ceph.git common/options,librbd/Utils: refactor RBD feature validation Move conversion of RBD features to/from string/uint64_t to helpers, and use those from the option validator. Keep the resulting features in integer form to avoid breaking Cinder. Meh. Change behavior from prior version: - fail to parse if any of the specified features is invalid (previously we would parse the ones we understood and ignore the others). Signed-off-by: Sage Weil --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b454f7d86604..5e1e949b7bd3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -536,6 +536,7 @@ set(libcommon_files common/dns_resolve.cc common/hostname.cc common/util.cc + librbd/Features.cc arch/probe.cc ${auth_files} ${mds_files}) diff --git a/src/common/options.cc b/src/common/options.cc index 505cf277e7fa..71d97704c2e7 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -14,6 +14,9 @@ // Definitions for enums #include "common/perf_counters.h" +// rbd feature validation +#include "librbd/Features.h" + void Option::dump_value(const char *field_name, const Option::value_t &v, Formatter *f) const @@ -5817,71 +5820,17 @@ static std::vector