]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/migration: don't clone when flattening
authorOr Ozeri <oro@il.ibm.com>
Tue, 31 Jan 2023 11:08:22 +0000 (13:08 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 18 Aug 2024 19:34:09 +0000 (21:34 +0200)
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>
src/librbd/api/Migration.cc

index 934e7be3b8f5ac07bddeaaf81a8a46b2b5035504..67b9028caeb22ccb752b842c2bbdb13240beb722 100644 (file)
@@ -1485,7 +1485,7 @@ int Migration<I>::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<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,