]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/migration: close source image in OpenSourceImageRequest
authorIlya Dryomov <idryomov@gmail.com>
Fri, 26 Jul 2024 10:13:08 +0000 (12:13 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 11 Aug 2024 17:14:06 +0000 (19:14 +0200)
commitff8401be9b7967fc786435fa1b847670ae0b0839
treef94de73f3fcd2c140f78f3cdc9b3576d6271e0b2
parente3e6e9c0858d68525778dc55e3327c2374e4d098
librbd/migration: close source image in OpenSourceImageRequest

Currently, on errors in FormatInterface::open(), RawFormat disposes
of src_image_ctx, but QCOWFormat doesn't, which is a leak.  Rather than
having each format do it internally, do it in OpenSourceImageRequest.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 63159d6b431470f5edc4b110cebf46865c550689)
src/librbd/migration/OpenSourceImageRequest.cc
src/librbd/migration/RawFormat.cc
src/test/librbd/migration/test_mock_RawFormat.cc