]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: optionally disable spec validation when creating images/snapshots
authorJason Dillaman <dillaman@redhat.com>
Thu, 14 Apr 2016 17:24:21 +0000 (13:24 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 14 Apr 2016 21:59:26 +0000 (17:59 -0400)
Setting the "rbd-validate-names" config propery to false will disable
spec validation.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd/Utils.cc

index 36021dc5f9f2c1f790ae182e4be820dcd2f750ab..f4441ddee97ed52000f7b787b355c209891fea90 100644 (file)
@@ -82,6 +82,10 @@ int read_string(int fd, unsigned max, std::string *out) {
 int extract_spec(const std::string &spec, std::string *pool_name,
                  std::string *image_name, std::string *snap_name,
                  SpecValidation spec_validation) {
+  if (!g_ceph_context->_conf->rbd_validate_names) {
+    spec_validation = SPEC_VALIDATION_NONE;
+  }
+
   boost::regex pattern;
   switch (spec_validation) {
   case SPEC_VALIDATION_FULL: