]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-replay: removed default rbd pool name
authorJason Dillaman <dillaman@redhat.com>
Tue, 6 Jun 2017 13:39:18 +0000 (09:39 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 7 Jun 2017 20:26:24 +0000 (16:26 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/rbd_replay/Replayer.cc
src/rbd_replay/rbd-replay.cc

index 3d57b0ad94590cc98c5f81731d919773481aabf3..ca1eaba84416fd74a4d4ad009a35b7be104b33e0 100644 (file)
@@ -162,8 +162,8 @@ rbd_loc Worker::map_image_name(string image_name, string snap_name) const {
 
 
 Replayer::Replayer(int num_action_trackers)
-  : m_rbd(NULL), m_ioctx(0),  
-    m_pool_name("rbd"), m_latency_multiplier(1.0), 
+  : m_rbd(NULL), m_ioctx(0),
+    m_latency_multiplier(1.0),
     m_readonly(false), m_dump_perf_counters(false),
     m_num_action_trackers(num_action_trackers),
     m_action_trackers(new action_tracker_d[m_num_action_trackers]) {
@@ -192,6 +192,16 @@ void Replayer::run(const std::string& replay_file) {
       cerr << "Failed to connect to cluster: " << cpp_strerror(r) << std::endl;
       goto out;
     }
+
+    if (m_pool_name.empty()) {
+      r = rados.conf_get("rbd_default_pool", m_pool_name);
+      if (r < 0) {
+        cerr << "Failed to retrieve default pool: " << cpp_strerror(r)
+             << std::endl;
+        goto out;
+      }
+    }
+
     m_ioctx = new librados::IoCtx();
     {
       r = rados.ioctx_create(m_pool_name.c_str(), *m_ioctx);
index 3ec490ecb3b04eccc0bbfe33ce21b2c78d9f87c6..274431c19f9415aefcaa8552681fd7d0217006a4 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, const char **argv) {
                         CODE_ENVIRONMENT_UTILITY, 0);
 
   std::vector<const char*>::iterator i;
-  string pool_name = "rbd";
+  string pool_name;
   float latency_multiplier = 1;
   bool readonly = false;
   ImageNameMap image_name_map;