[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/20] block/vvfat: inherit child_vvfat_qcow from child_of_bds
From: |
Kevin Wolf |
Subject: |
[PULL 13/20] block/vvfat: inherit child_vvfat_qcow from child_of_bds |
Date: |
Wed, 2 Jun 2021 15:45:22 +0200 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Recently we've fixed a crash by adding .get_parent_aio_context handler
to child_vvfat_qcow. Now we want it to support .get_parent_desc as
well. child_vvfat_qcow wants to implement own .inherit_options, it's
not bad. But omitting all other handlers is a bad idea. Let's inherit
the class from child_of_bds instead, similar to chain_child_class and
detach_by_driver_cb_class in test-bdrv-drain.c.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210601075218.79249-5-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/vvfat.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index 86d99c899c..ae9d387da7 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -3127,11 +3127,7 @@ static void vvfat_qcow_options(BdrvChildRole role, bool
parent_is_format,
qdict_set_default_str(child_options, BDRV_OPT_CACHE_NO_FLUSH, "on");
}
-static const BdrvChildClass child_vvfat_qcow = {
- .parent_is_bds = true,
- .inherit_options = vvfat_qcow_options,
- .get_parent_aio_context = child_of_bds_get_parent_aio_context,
-};
+static BdrvChildClass child_vvfat_qcow;
static int enable_write_target(BlockDriverState *bs, Error **errp)
{
@@ -3268,6 +3264,8 @@ static BlockDriver bdrv_vvfat = {
static void bdrv_vvfat_init(void)
{
+ child_vvfat_qcow = child_of_bds;
+ child_vvfat_qcow.inherit_options = vvfat_qcow_options;
bdrv_register(&bdrv_vvfat);
}
--
2.30.2
- [PULL 04/20] block/vvfat: fix vvfat_child_perm crash, (continued)
- [PULL 04/20] block/vvfat: fix vvfat_child_perm crash, Kevin Wolf, 2021/06/02
- [PULL 05/20] block: consistently use bdrv_is_read_only(), Kevin Wolf, 2021/06/02
- [PULL 06/20] block: drop BlockDriverState::read_only, Kevin Wolf, 2021/06/02
- [PULL 07/20] block: drop BlockBackendRootState::read_only, Kevin Wolf, 2021/06/02
- [PULL 09/20] block/file-posix: Try other fallbacks after invalid FALLOC_FL_ZERO_RANGE, Kevin Wolf, 2021/06/02
- [PULL 08/20] block/file-posix: Fix problem with fallocate(PUNCH_HOLE) on GPFS, Kevin Wolf, 2021/06/02
- [PULL 10/20] block: document child argument of bdrv_attach_child_common(), Kevin Wolf, 2021/06/02
- [PULL 11/20] block-backend: improve blk_root_get_parent_desc(), Kevin Wolf, 2021/06/02
- [PULL 12/20] block: improve bdrv_child_get_parent_desc(), Kevin Wolf, 2021/06/02
- [PULL 14/20] block: simplify bdrv_child_user_desc(), Kevin Wolf, 2021/06/02
- [PULL 13/20] block/vvfat: inherit child_vvfat_qcow from child_of_bds,
Kevin Wolf <=
- [PULL 15/20] block: improve permission conflict error message, Kevin Wolf, 2021/06/02
- [PULL 16/20] block-backend: add drained_poll, Kevin Wolf, 2021/06/02
- [PULL 17/20] nbd/server: Use drained block ops to quiesce the server, Kevin Wolf, 2021/06/02
- [PULL 20/20] docs/secure-coding-practices: Describe how to use 'null-co' block driver, Kevin Wolf, 2021/06/02
- [PULL 19/20] block-copy: refactor copy_range handling, Kevin Wolf, 2021/06/02
- [PULL 18/20] block-copy: fix block_copy_task_entry() progress update, Kevin Wolf, 2021/06/02
- Re: [PULL 00/20] Block layer patches, Peter Maydell, 2021/06/03