]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: tweaks to support creating mock test cases
authorMykola Golub <mgolub@mirantis.com>
Mon, 21 Nov 2016 07:57:40 +0000 (09:57 +0200)
committerMykola Golub <mgolub@mirantis.com>
Thu, 12 Jan 2017 17:14:48 +0000 (18:14 +0100)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/tools/rbd_mirror/ImageReplayer.cc
src/tools/rbd_mirror/image_replayer/EventPreprocessor.h
src/tools/rbd_mirror/image_replayer/ReplayStatusFormatter.h

index 68a6539f78cf72f27e73fbb4a4cebb19c1027849..71e5a479b0f7d3f602d8cbff36d5e503ae05b39e 100644 (file)
@@ -1380,7 +1380,7 @@ void ImageReplayer<I>::shut_down(int r) {
           m_local_journal->stop_external_replay();
           m_local_replay = nullptr;
 
-          delete m_event_preprocessor;
+          EventPreprocessor<I>::destroy(m_event_preprocessor);
           m_event_preprocessor = nullptr;
           ctx->complete(0);
         });
@@ -1449,7 +1449,7 @@ void ImageReplayer<I>::handle_shut_down(int r) {
   m_local_ioctx.close();
   m_remote_ioctx.close();
 
-  delete m_replay_status_formatter;
+  ReplayStatusFormatter<I>::destroy(m_replay_status_formatter);
   m_replay_status_formatter = nullptr;
 
   Context *on_start = nullptr;
index 6cdf0f61bf4299887ddcec972aba33680b26e23e..67aeea0b807520ad51554d5fa4b0176fb2f75cdd 100644 (file)
@@ -36,6 +36,10 @@ public:
                                  local_mirror_uuid, client_meta, work_queue);
   }
 
+  static void destroy(EventPreprocessor* processor) {
+    delete processor;
+  }
+
   EventPreprocessor(ImageCtxT &local_image_ctx, Journaler &remote_journaler,
                     const std::string &local_mirror_uuid,
                     MirrorPeerClientMeta *client_meta, ContextWQ *work_queue);
index 00d7a05a52ec32764d043eac2b2deccfcebe8008..59940a651fbca1ce76d0934daf6a48461f07db33 100644 (file)
@@ -27,6 +27,10 @@ public:
     return new ReplayStatusFormatter(journaler, mirror_uuid);
   }
 
+  static void destroy(ReplayStatusFormatter* formatter) {
+    delete formatter;
+  }
+
   ReplayStatusFormatter(Journaler *journaler, const std::string &mirror_uuid);
 
   bool get_or_send_update(std::string *description, Context *on_finish);