From: Or Ozeri Date: Tue, 31 Jan 2023 11:08:22 +0000 (+0200) Subject: librbd/migration: don't clone when flattening X-Git-Tag: v20.0.0~1226^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1ee644d97104c9caaa83918b98b388888fc5497b;p=ceph.git librbd/migration: don't clone when flattening 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 Signed-off-by: Ilya Dryomov --- diff --git a/src/librbd/api/Migration.cc b/src/librbd/api/Migration.cc index 934e7be3b8f5a..67b9028caeb22 100644 --- a/src/librbd/api/Migration.cc +++ b/src/librbd/api/Migration.cc @@ -1485,7 +1485,7 @@ int Migration::create_dst_image(I** image_ctx) { 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::create( config, m_dst_io_ctx, m_dst_image_name, m_dst_image_id, size, m_image_options, image::CREATE_FLAG_SKIP_MIRROR_ENABLE,