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_OPEN_IMAGE_REQUEST_H
5 #define RBD_MIRROR_IMAGE_REPLAYER_OPEN_IMAGE_REQUEST_H
7 #include "include/int_types.h"
8 #include "librbd/ImageCtx.h"
12 namespace librbd { class ImageCtx; }
16 namespace image_replayer {
18 template <typename ImageCtxT = librbd::ImageCtx>
19 class OpenImageRequest {
21 static OpenImageRequest* create(librados::IoCtx &io_ctx,
22 ImageCtxT **image_ctx,
23 const std::string &image_id,
24 bool read_only, Context *on_finish) {
25 return new OpenImageRequest(io_ctx, image_ctx, image_id, read_only,
29 OpenImageRequest(librados::IoCtx &io_ctx, ImageCtxT **image_ctx,
30 const std::string &image_id, bool read_only,
49 librados::IoCtx &m_io_ctx;
50 ImageCtxT **m_image_ctx;
51 std::string m_image_id;
55 void send_open_image();
56 void handle_open_image(int r);
58 void send_close_image(int r);
59 void handle_close_image(int r);
65 } // namespace image_replayer
69 extern template class rbd::mirror::image_replayer::OpenImageRequest<librbd::ImageCtx>;
71 #endif // RBD_MIRROR_IMAGE_REPLAYER_OPEN_IMAGE_REQUEST_H