]>
git.proxmox.com Git - ceph.git/blob - ceph/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.h
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_LOCAL_IMAGE_REQUEST_H
5 #define RBD_MIRROR_IMAGE_REPLAYER_PREPARE_LOCAL_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 PrepareLocalImageRequest
{
23 static PrepareLocalImageRequest
*create(librados::IoCtx
&io_ctx
,
24 const std::string
&global_image_id
,
25 std::string
*local_image_id
,
26 std::string
*local_image_name
,
27 std::string
*tag_owner
,
28 ContextWQ
*work_queue
,
30 return new PrepareLocalImageRequest(io_ctx
, global_image_id
, local_image_id
,
31 local_image_name
, tag_owner
, work_queue
,
35 PrepareLocalImageRequest(librados::IoCtx
&io_ctx
,
36 const std::string
&global_image_id
,
37 std::string
*local_image_id
,
38 std::string
*local_image_name
,
39 std::string
*tag_owner
,
40 ContextWQ
*work_queue
,
42 : m_io_ctx(io_ctx
), m_global_image_id(global_image_id
),
43 m_local_image_id(local_image_id
), m_local_image_name(local_image_name
),
44 m_tag_owner(tag_owner
), m_work_queue(work_queue
), m_on_finish(on_finish
) {
59 * GET_LOCAL_IMAGE_NAME
70 librados::IoCtx
&m_io_ctx
;
71 std::string m_global_image_id
;
72 std::string
*m_local_image_id
;
73 std::string
*m_local_image_name
;
74 std::string
*m_tag_owner
;
75 ContextWQ
*m_work_queue
;
80 void get_local_image_id();
81 void handle_get_local_image_id(int r
);
83 void get_local_image_name();
84 void handle_get_local_image_name(int r
);
86 void get_mirror_state();
87 void handle_get_mirror_state(int r
);
90 void handle_get_tag_owner(int r
);
96 } // namespace image_replayer
100 extern template class rbd::mirror::image_replayer::PrepareLocalImageRequest
<librbd::ImageCtx
>;
102 #endif // RBD_MIRROR_IMAGE_REPLAYER_PREPARE_LOCAL_IMAGE_REQUEST_H