]> git.proxmox.com Git - ceph.git/blame - ceph/src/tools/rbd_mirror/MirrorStatusWatcher.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / tools / rbd_mirror / MirrorStatusWatcher.h
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3
4#ifndef CEPH_RBD_MIRROR_MIRROR_STATUS_WATCHER_H
5#define CEPH_RBD_MIRROR_MIRROR_STATUS_WATCHER_H
6
7#include "librbd/Watcher.h"
8
9namespace librbd { class ImageCtx; }
10
11namespace rbd {
12namespace mirror {
13
14template <typename ImageCtxT = librbd::ImageCtx>
15class MirrorStatusWatcher : protected librbd::Watcher {
16public:
17 static MirrorStatusWatcher *create(librados::IoCtx &io_ctx,
18 ContextWQ *work_queue) {
19 return new MirrorStatusWatcher(io_ctx, work_queue);
20 }
21 void destroy() {
22 delete this;
23 }
24
25 MirrorStatusWatcher(librados::IoCtx &io_ctx, ContextWQ *work_queue);
26 ~MirrorStatusWatcher() override;
27
28 void init(Context *on_finish);
29 void shut_down(Context *on_finish);
30
31protected:
32 void handle_notify(uint64_t notify_id, uint64_t handle,
33 uint64_t notifier_id, bufferlist &bl) override;
34};
35
36} // namespace mirror
37} // namespace rbd
38
39#endif // CEPH_RBD_MIRROR_MIRROR_STATUS_WATCHER_H