From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/librbd/migration/SourceSpecBuilder.h | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/librbd/migration/SourceSpecBuilder.h (limited to 'src/librbd/migration/SourceSpecBuilder.h') diff --git a/src/librbd/migration/SourceSpecBuilder.h b/src/librbd/migration/SourceSpecBuilder.h new file mode 100644 index 000000000..191cb1cbd --- /dev/null +++ b/src/librbd/migration/SourceSpecBuilder.h @@ -0,0 +1,54 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#ifndef CEPH_LIBRBD_MIGRATION_SOURCE_SPEC_BUILDER_H +#define CEPH_LIBRBD_MIGRATION_SOURCE_SPEC_BUILDER_H + +#include "include/int_types.h" +#include +#include +#include +#include + +struct Context; + +namespace librbd { + +struct ImageCtx; + +namespace migration { + +struct FormatInterface; +struct SnapshotInterface; +struct StreamInterface; + +template +class SourceSpecBuilder { +public: + SourceSpecBuilder(ImageCtxT* image_ctx) : m_image_ctx(image_ctx) { + } + + int parse_source_spec(const std::string& source_spec, + json_spirit::mObject* source_spec_object) const; + + int build_format(const json_spirit::mObject& format_object, bool import_only, + std::unique_ptr* format) const; + + int build_snapshot(const json_spirit::mObject& source_spec_object, + uint64_t index, + std::shared_ptr* snapshot) const; + + int build_stream(const json_spirit::mObject& source_spec_object, + std::shared_ptr* stream) const; + +private: + ImageCtxT* m_image_ctx; + +}; + +} // namespace migration +} // namespace librbd + +extern template class librbd::migration::SourceSpecBuilder; + +#endif // CEPH_LIBRBD_MIGRATION_SOURCE_SPEC_BUILDER_H -- cgit v1.2.3