block/copy-before-write: create block_copy bitmap in filter node
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Wed, 13 Mar 2024 15:28:20 +0000 (18:28 +0300)
committerVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tue, 28 May 2024 12:52:15 +0000 (15:52 +0300)
commit006e845b5a4cbb1f93a2e8ed22fa648b9d7e4182
treef40283437757be89d85949e06eff6bde9dbe48b8
parent507175197b06a24beb2369abe95b00172741c457
block/copy-before-write: create block_copy bitmap in filter node

Currently block_copy creates copy_bitmap in source node. But that is in
bad relation with .independent_close=true of copy-before-write filter:
source node may be detached and removed before .bdrv_close() handler
called, which should call block_copy_state_free(), which in turn should
remove copy_bitmap.

That's all not ideal: it would be better if internal bitmap of
block-copy object is not attached to any node. But that is not possible
now.

The simplest solution is just create copy_bitmap in filter node, where
anyway two other bitmaps are created.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Message-Id: <20240313152822.626493-4-vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
block/block-copy.c
block/copy-before-write.c
include/block/block-copy.h
tests/qemu-iotests/257.out