]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/erasure-code/ceph_erasure_code_benchmark.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / test / erasure-code / ceph_erasure_code_benchmark.cc
index 4a810c7ebe32faf8b948a6ab3f46bfbe44e9f534..2bcb5f3cd3b0aa69b9e4b74100ee96ff6c256d1d 100644 (file)
@@ -121,10 +121,15 @@ int ErasureCodeBench::setup(int argc, char** argv) {
     exhaustive_erasures = false;
   if (vm.count("erased") > 0)
     erased = vm["erased"].as<vector<int> >();
-
-  k = stoi(profile["k"]);
-  m = stoi(profile["m"]);
   
+  try {
+    k = stoi(profile["k"]);
+    m = stoi(profile["m"]);
+  } catch (const std::logic_error& e) {
+    cout << "Invalid k and/or m: k=" << profile["k"] << ", m=" << profile["m"] 
+         << " (" << e.what() << ")" << endl;
+    return -EINVAL;
+  }
   if (k <= 0) {
     cout << "parameter k is " << k << ". But k needs to be > 0." << endl;
     return -EINVAL;