]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: Added image-deleter thread to rbd-mirror
authorRicardo Dias <rdias@suse.com>
Thu, 28 Apr 2016 10:48:05 +0000 (11:48 +0100)
committerJason Dillaman <dillaman@redhat.com>
Sun, 22 May 2016 20:13:20 +0000 (16:13 -0400)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/tools/rbd_mirror/Mirror.cc
src/tools/rbd_mirror/Mirror.h

index 98787805593a61fe49c1d5980cdab5c674c7cf8d..a5bc849acdccadc9093128f770ea1129468bdf7c 100644 (file)
@@ -216,6 +216,9 @@ int Mirror::init()
   // TODO: make interval configurable
   m_local_cluster_watcher.reset(new ClusterWatcher(m_local, m_lock));
 
+  m_image_deleter.reset(new ImageDeleter(m_local, m_threads->timer,
+                                         &m_threads->timer_lock));
+
   return r;
 }
 
@@ -254,6 +257,13 @@ void Mirror::print_status(Formatter *f, stringstream *ss)
     replayer->print_status(f, ss);
   }
 
+  if (f) {
+    f->close_section();
+    f->open_object_section("image_deleter");
+  }
+
+  m_image_deleter->print_status(f, ss);
+
   if (f) {
     f->close_section();
     f->close_section();
index 298f805198750b59995f74ff8b7ff53b2c2a3255..20efe0d94cc13e950e10570ad7065b1b3287a41f 100644 (file)
@@ -14,6 +14,7 @@
 #include "include/rados/librados.hpp"
 #include "ClusterWatcher.h"
 #include "Replayer.h"
+#include "ImageDeleter.h"
 #include "types.h"
 
 namespace rbd {
@@ -59,6 +60,7 @@ private:
   // monitor local cluster for config changes in peers
   std::unique_ptr<ClusterWatcher> m_local_cluster_watcher;
   std::map<peer_t, std::unique_ptr<Replayer> > m_replayers;
+  std::shared_ptr<ImageDeleter> m_image_deleter;
   atomic_t m_stopping;
   bool m_manual_stop = false;
   MirrorAdminSocketHook *m_asok_hook;