From 25c034f0a0a627b54a1e4b948292890385cb7b6d Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 20 Apr 2020 19:34:57 -0400 Subject: [PATCH] librbd: save requested mirror image mode during migration prepare Once the migration is committed, the requested mode will be applied. Signed-off-by: Jason Dillaman --- src/librbd/api/Migration.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/librbd/api/Migration.cc b/src/librbd/api/Migration.cc index 81f1ed0cd58..106eae6d443 100644 --- a/src/librbd/api/Migration.cc +++ b/src/librbd/api/Migration.cc @@ -1227,6 +1227,15 @@ int Migration::create_dst_image() { ConfigProxy config{m_cct->_conf}; api::Config::apply_pool_overrides(m_dst_io_ctx, &config); + uint64_t mirror_image_mode; + if (m_image_options.get(RBD_IMAGE_OPTION_MIRROR_IMAGE_MODE, + &mirror_image_mode) == 0) { + m_mirroring = true; + m_mirror_image_mode = static_cast( + mirror_image_mode); + m_image_options.unset(RBD_IMAGE_OPTION_MIRROR_IMAGE_MODE); + } + int r; C_SaferCond on_create; librados::IoCtx parent_io_ctx;