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_PREPARE_REMOTE_IMAGE_REQUEST_H
5 #define RBD_MIRROR_IMAGE_REPLAYER_PREPARE_REMOTE_IMAGE_REQUEST_H
7 #include "include/buffer.h"
10 namespace librados
{ struct IoCtx
; }
11 namespace librbd
{ struct ImageCtx
; }
18 namespace image_replayer
{
20 template <typename ImageCtxT
= librbd::ImageCtx
>
21 class PrepareRemoteImageRequest
{
23 static PrepareRemoteImageRequest
*create(librados::IoCtx
&io_ctx
,
24 const std::string
&global_image_id
,
25 std::string
*remote_mirror_uuid
,
26 std::string
*remote_image_id
,
28 return new PrepareRemoteImageRequest(io_ctx
, global_image_id
,
29 remote_mirror_uuid
, remote_image_id
,
33 PrepareRemoteImageRequest(librados::IoCtx
&io_ctx
,
34 const std::string
&global_image_id
,
35 std::string
*remote_mirror_uuid
,
36 std::string
*remote_image_id
,
38 : m_io_ctx(io_ctx
), m_global_image_id(global_image_id
),
39 m_remote_mirror_uuid(remote_mirror_uuid
),
40 m_remote_image_id(remote_image_id
),
41 m_on_finish(on_finish
) {
53 * GET_REMOTE_MIRROR_UUID
64 librados::IoCtx
&m_io_ctx
;
65 std::string m_global_image_id
;
66 std::string
*m_remote_mirror_uuid
;
67 std::string
*m_remote_image_id
;
72 void get_remote_mirror_uuid();
73 void handle_get_remote_mirror_uuid(int r
);
75 void get_remote_image_id();
76 void handle_get_remote_image_id(int r
);
82 } // namespace image_replayer
86 extern template class rbd::mirror::image_replayer::PrepareRemoteImageRequest
<librbd::ImageCtx
>;
88 #endif // RBD_MIRROR_IMAGE_REPLAYER_PREPARE_REMOTE_IMAGE_REQUEST_H