]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: re-use pool config override helper method 24450/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 8 Oct 2018 18:08:30 +0000 (14:08 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 8 Oct 2018 18:08:30 +0000 (14:08 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/rbd_mirror/test_mock_PoolReplayer.cc
src/tools/rbd_mirror/PoolReplayer.cc
src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.h

index c7f0909cd518715e992b6a2a2ee4a13fb7e8f63a..8e6f80bf5d393e7488333fc08e8308bb4dc3e123 100644 (file)
@@ -36,9 +36,8 @@ namespace api {
 template <>
 class Config<MockTestImageCtx> {
 public:
-  static int list(librados::IoCtx& io_ctx,
-                  std::vector<config_option_t> *options) {
-    return 0;
+  static void apply_pool_overrides(librados::IoCtx& io_ctx,
+                                   ConfigProxy* config_proxy) {
   }
 };
 
index 8d0ec509df181ffb4f83baf27671e0a704f2b5e5..a98a101f983031b5fe399430ea25d827852e872e 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+
 // vim: ts=8 sw=2 smarttab
 
 #include "PoolReplayer.h"
@@ -306,20 +306,8 @@ void PoolReplayer<I>::init()
     return;
   }
 
-  std::vector<librbd::config_option_t> options;
-  r = librbd::api::Config<I>::list(m_local_io_ctx, &options);
-  if (r < 0) {
-    derr << "error listing local pool config overrides: " << cpp_strerror(r)
-         << dendl;
-    return;
-  }
   auto cct = reinterpret_cast<CephContext *>(m_local_io_ctx.cct());
-  for (auto &option : options) {
-    if (option.source == RBD_CONFIG_SOURCE_POOL) {
-      r = cct->_conf.set_val(option.name.c_str(), option.value);
-      assert(r == 0);
-    }
-  }
+  librbd::api::Config<I>::apply_pool_overrides(m_local_io_ctx, &cct->_conf);
 
   std::string local_mirror_uuid;
   r = librbd::cls_client::mirror_uuid_get(&m_local_io_ctx,
index e0b4898cac3f5b50df3bbf500855429af5e94ed6..d93605109b889b9af736688a905cc6ab4717ed6e 100644 (file)
@@ -68,6 +68,7 @@ public:
     : m_threads(threads), m_remote_io_ctx(remote_io_ctx),
       m_global_image_id(global_image_id),
       m_local_mirror_uuid(local_mirror_uuid), m_local_image_id(local_image_id),
+      m_journal_settings(journal_settings),
       m_remote_mirror_uuid(remote_mirror_uuid),
       m_remote_image_id(remote_image_id),
       m_remote_journaler(remote_journaler), m_client_state(client_state),