1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef RBD_MIRROR_IMAGE_REPLAYER_JOURNAL_PREPARE_REPLAY_REQUEST_H
5 #define RBD_MIRROR_IMAGE_REPLAYER_JOURNAL_PREPARE_REPLAY_REQUEST_H
7 #include "include/int_types.h"
8 #include "librbd/mirror/Types.h"
9 #include "tools/rbd_mirror/BaseRequest.h"
14 namespace librbd
{ struct ImageCtx
; }
19 class ProgressContext
;
21 namespace image_replayer
{
24 template <typename
> class StateBuilder
;
26 template <typename ImageCtxT
>
27 class PrepareReplayRequest
: public BaseRequest
{
29 static PrepareReplayRequest
* create(
30 const std::string
& local_mirror_uuid
,
31 ProgressContext
* progress_ctx
,
32 StateBuilder
<ImageCtxT
>* state_builder
,
33 bool* resync_requested
,
36 return new PrepareReplayRequest(
37 local_mirror_uuid
, progress_ctx
, state_builder
, resync_requested
,
42 const std::string
& local_mirror_uuid
,
43 ProgressContext
* progress_ctx
,
44 StateBuilder
<ImageCtxT
>* state_builder
,
45 bool* resync_requested
,
48 : BaseRequest(on_finish
),
49 m_local_mirror_uuid(local_mirror_uuid
),
50 m_progress_ctx(progress_ctx
),
51 m_state_builder(state_builder
),
52 m_resync_requested(resync_requested
),
66 * LOAD_LOCAL_IMAGE_META
74 std::string m_local_mirror_uuid
;
75 ProgressContext
* m_progress_ctx
;
76 StateBuilder
<ImageCtxT
>* m_state_builder
;
77 bool* m_resync_requested
;
80 void load_local_image_meta();
81 void handle_load_local_image_meta(int r
);
85 } // namespace snapshot
86 } // namespace image_replayer
90 extern template class rbd::mirror::image_replayer::snapshot::PrepareReplayRequest
<librbd::ImageCtx
>;
92 #endif // RBD_MIRROR_IMAGE_REPLAYER_JOURNAL_PREPARE_REPLAY_REQUEST_H