librbd/api: ImageCtx must be closed instead of deleted

On error, the destination image context will need to be properly
closed instead of just deleted.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2020-10-20 02:55:36 -04:00
parent 6fef5198b3
commit 43749377cb

View File

@ -753,7 +753,7 @@ int Migration<I>::prepare() {
BOOST_SCOPE_EXIT_TPL(&m_dst_image_ctx) {
if (m_dst_image_ctx != nullptr) {
delete m_dst_image_ctx;
m_dst_image_ctx->state->close();
}
} BOOST_SCOPE_EXIT_END;