]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/: add paranoid option to ceph-osdomap-tool
authorSamuel Just <sam.just@inktank.com>
Thu, 2 May 2013 19:49:34 +0000 (12:49 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 2 May 2013 19:54:28 +0000 (12:54 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/tools/ceph-osdomap-tool.cc

index 28a407ca15107159173fd31d729d1bc0b4167021..49316b2fd90688adc70e9bdbd79bdac990df62a5 100644 (file)
@@ -39,10 +39,13 @@ using namespace std;
 int main(int argc, char **argv) {
   po::options_description desc("Allowed options");
   string store_path, cmd, out_path;
+  bool paranoid = false;
   desc.add_options()
     ("help", "produce help message")
     ("omap-path", po::value<string>(&store_path),
      "path to mon directory, mandatory (current/omap usually)")
+    ("paranoid", po::value<bool>(&paranoid),
+     "use paranoid checking")
     ("command", po::value<string>(&cmd),
      "command")
     ;
@@ -85,6 +88,10 @@ int main(int argc, char **argv) {
   }
 
   LevelDBStore* store(new LevelDBStore(store_path));
+  if (paranoid) {
+    std::cerr << "Enabling paranoid checks" << std::endl;
+    store->options.paranoid_checks = paranoid;
+  }
   DBObjectMap omap(store);
   stringstream out;
   int r = store->open(out);