OSDN Git Service

block/copy-before-write: make public block driver
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 24 Aug 2021 08:38:43 +0000 (11:38 +0300)
committerHanna Reitz <hreitz@redhat.com>
Wed, 1 Sep 2021 12:03:47 +0000 (14:03 +0200)
commit751cec7a261adaf1145dc7adf6de7c9c084e5a0b
treed53c503d89f8711a704481d48bf8173522e52485
parent201b4bb6c78b5845ec7a77fca1714a599dd76849
block/copy-before-write: make public block driver

Finally, copy-before-write gets own .bdrv_open and .bdrv_close
handlers, block_init() call and becomes available through bdrv_open().

To achieve this:

 - cbw_init gets unused flags argument and becomes cbw_open
 - block_copy_state_free() call moved to new cbw_close()
 - in bdrv_cbw_append:
   - options are completed with driver and node-name, and we can simply
     use bdrv_insert_node() to do both open and drained replacing
 - in bdrv_cbw_drop:
   - cbw_close() is now responsible for freeing s->bcs, so don't do it
     here

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210824083856.17408-22-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
block/copy-before-write.c