OPTION(rbd_mirroring_resync_after_disconnect, OPT_BOOL, false) // automatically start image resync after mirroring is disconnected due to being laggy
OPTION(rbd_mirroring_replay_delay, OPT_INT, 0) // time-delay in seconds for rbd-mirror asynchronous replication
+OPTION(rbd_default_pool, OPT_STR, "rbd") // default pool for storing images
+OPTION_VALIDATOR(rbd_default_pool)
+
/*
* The following options change the behavior for librbd's image creation methods that
* don't require all of the parameters. These are provided so that older programs
OPTION(rbd_default_stripe_count, OPT_U64, 0) // changing requires stripingv2 feature
OPTION(rbd_default_stripe_unit, OPT_U64, 0) // changing to non-object size requires stripingv2 feature
OPTION(rbd_default_data_pool, OPT_STR, "") // optional default pool for storing image data blocks
+OPTION_VALIDATOR(rbd_default_data_pool)
/**
* RBD features are only applicable for v2 images. This setting accepts either
#include <vector>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
+#include <boost/regex.hpp>
+
+int validate(md_config_t::option_rbd_default_pool_t *,
+ std::string *value, std::string *error_message) {
+ boost::regex pattern("^[^@/]+$");
+ if (!boost::regex_match (*value, pattern)) {
+ *value = "rbd";
+ *error_message = "invalid RBD default pool, resetting to 'rbd'";
+ }
+ return 0;
+}
+
+int validate(md_config_t::option_rbd_default_data_pool_t *,
+ std::string *value, std::string *error_message) {
+ boost::regex pattern("^[^@/]*$");
+ if (!boost::regex_match (*value, pattern)) {
+ *value = "";
+ *error_message = "ignoring invalid RBD data pool";
+ }
+ return 0;
+}
int validate(md_config_t::option_rbd_default_features_t *,
std::string *value, std::string *error_message) {
* Global config value validators for the Ceph project
*/
+int validate(md_config_t::option_rbd_default_pool_t *type,
+ std::string *value, std::string *error_message);
+int validate(md_config_t::option_rbd_default_data_pool_t *type,
+ std::string *value, std::string *error_message);
int validate(md_config_t::option_rbd_default_features_t *type,
std::string *value, std::string *error_message);