]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/RocksDBStore: behave if options string is empty
authorSage Weil <sage@redhat.com>
Mon, 14 Dec 2015 21:27:17 +0000 (16:27 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:07:17 +0000 (13:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/kv/RocksDBStore.cc

index 9b99605b62e32ac3d4241049124bd7a57e81e026..d476c866834f2bfab2668f42c7f265da00f6dac4 100644 (file)
@@ -144,9 +144,11 @@ int RocksDBStore::init(string _options_str)
   options_str = _options_str;
   rocksdb::Options opt;
   //try parse options
-  int r = ParseOptionsFromString(options_str, opt); 
-  if (r != 0) {
-    return -EINVAL;
+  if (options_str.length()) {
+    int r = ParseOptionsFromString(options_str, opt);
+    if (r != 0) {
+      return -EINVAL;
+    }
   }
   return 0;
 }
@@ -174,9 +176,11 @@ int RocksDBStore::do_open(ostream &out, bool create_if_missing)
   rocksdb::Options opt;
   rocksdb::Status status;
 
-  int r = ParseOptionsFromString(options_str, opt); 
-  if (r != 0) {
-    return -EINVAL;
+  if (options_str.length()) {
+    int r = ParseOptionsFromString(options_str, opt);
+    if (r != 0) {
+      return -EINVAL;
+    }
   }
   opt.create_if_missing = create_if_missing;
   if (g_conf->rocksdb_separate_wal_dir) {