When the flatten flag is set, instead of creating the
destination image by cloning, create it independently,
as the parent relation is unnecessary in this case.
This will be particularly useful when the migration source
is located in an external Ceph cluster, which will soon be
supported.
Signed-off-by: Or Ozeri <oro@il.ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit
1ee644d97104c9caaa83918b98b388888fc5497b)
int r;
C_SaferCond on_create;
librados::IoCtx parent_io_ctx;
- if (parent_spec.pool_id == -1) {
+ if (parent_spec.pool_id == -1 || m_flatten) {
auto *req = image::CreateRequest<I>::create(
config, m_dst_io_ctx, m_dst_image_name, m_dst_image_id, size,
m_image_options, image::CREATE_FLAG_SKIP_MIRROR_ENABLE,