[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 44/51] block: Drop child_file
From: |
Kevin Wolf |
Subject: |
[PULL 44/51] block: Drop child_file |
Date: |
Fri, 15 May 2020 14:45:14 +0200 |
From: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
include/block/block_int.h | 1 -
block.c | 39 ++-------------------------------------
tests/test-bdrv-drain.c | 8 +++-----
3 files changed, 5 insertions(+), 43 deletions(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index e791c40496..7fbe3206b4 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -741,7 +741,6 @@ struct BdrvChildClass {
};
extern const BdrvChildClass child_of_bds;
-extern const BdrvChildClass child_file;
struct BdrvChild {
BlockDriverState *bs;
diff --git a/block.c b/block.c
index e79fe6e07e..6a24b23d51 100644
--- a/block.c
+++ b/block.c
@@ -80,13 +80,6 @@ static BlockDriverState *bdrv_open_inherit(const char
*filename,
BdrvChildRole child_role,
Error **errp);
-/* TODO: Remove when no longer needed */
-static void bdrv_inherited_options(BdrvChildRole role, bool parent_is_format,
- int *child_flags, QDict *child_options,
- int parent_flags, QDict *parent_options);
-static void bdrv_child_cb_attach(BdrvChild *child);
-static void bdrv_child_cb_detach(BdrvChild *child);
-
/* If non-zero, use only whitelisted block drivers */
static int use_bdrv_whitelist;
@@ -1145,33 +1138,6 @@ static void bdrv_temp_snapshot_options(int *child_flags,
QDict *child_options,
*child_flags &= ~BDRV_O_NATIVE_AIO;
}
-/*
- * Returns the options and flags that bs->file should get if a protocol driver
- * is expected, based on the given options and flags for the parent BDS
- */
-static void bdrv_protocol_options(BdrvChildRole role, bool parent_is_format,
- int *child_flags, QDict *child_options,
- int parent_flags, QDict *parent_options)
-{
- bdrv_inherited_options(BDRV_CHILD_IMAGE, true,
- child_flags, child_options,
- parent_flags, parent_options);
-}
-
-const BdrvChildClass child_file = {
- .parent_is_bds = true,
- .get_parent_desc = bdrv_child_get_parent_desc,
- .inherit_options = bdrv_protocol_options,
- .drained_begin = bdrv_child_cb_drained_begin,
- .drained_poll = bdrv_child_cb_drained_poll,
- .drained_end = bdrv_child_cb_drained_end,
- .attach = bdrv_child_cb_attach,
- .detach = bdrv_child_cb_detach,
- .inactivate = bdrv_child_cb_inactivate,
- .can_set_aio_ctx = bdrv_child_cb_can_set_aio_ctx,
- .set_aio_ctx = bdrv_child_cb_set_aio_ctx,
-};
-
static void bdrv_backing_attach(BdrvChild *c)
{
BlockDriverState *parent = c->opaque;
@@ -2444,9 +2410,8 @@ static void
bdrv_default_perms_for_storage(BlockDriverState *bs, BdrvChild *c,
{
int flags;
- assert(child_class == &child_file ||
- (child_class == &child_of_bds &&
- (role & (BDRV_CHILD_METADATA | BDRV_CHILD_DATA))));
+ assert(child_class == &child_of_bds &&
+ (role & (BDRV_CHILD_METADATA | BDRV_CHILD_DATA)));
flags = bdrv_reopen_get_flags(reopen_queue, bs);
diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c
index 0da5a3a6a1..655fd0d085 100644
--- a/tests/test-bdrv-drain.c
+++ b/tests/test-bdrv-drain.c
@@ -93,12 +93,10 @@ static void bdrv_test_child_perm(BlockDriverState *bs,
BdrvChild *c,
uint64_t *nperm, uint64_t *nshared)
{
/*
- * bdrv_default_perms() accepts only these two, so disguise
- * detach_by_driver_cb_parent as one of them.
+ * bdrv_default_perms() accepts nothing else, so disguise
+ * detach_by_driver_cb_parent.
*/
- if (child_class != &child_file && child_class != &child_of_bds) {
- child_class = &child_of_bds;
- }
+ child_class = &child_of_bds;
bdrv_default_perms(bs, c, child_class, role, reopen_queue,
perm, shared, nperm, nshared);
--
2.25.4
- [PULL 37/51] block: Make format drivers use child_of_bds, (continued)
- [PULL 37/51] block: Make format drivers use child_of_bds, Kevin Wolf, 2020/05/15
- [PULL 35/51] block: Make backing files child_of_bds children, Kevin Wolf, 2020/05/15
- [PULL 36/51] block: Drop child_backing, Kevin Wolf, 2020/05/15
- [PULL 38/51] block: Make filter drivers use child_of_bds, Kevin Wolf, 2020/05/15
- [PULL 39/51] block: Use child_of_bds in remaining places, Kevin Wolf, 2020/05/15
- [PULL 40/51] tests: Use child_of_bds instead of child_file, Kevin Wolf, 2020/05/15
- [PULL 41/51] block: Use bdrv_default_perms(), Kevin Wolf, 2020/05/15
- [PULL 43/51] block: Drop bdrv_format_default_perms(), Kevin Wolf, 2020/05/15
- [PULL 46/51] block: Drop @child_class from bdrv_child_perm(), Kevin Wolf, 2020/05/15
- [PULL 42/51] block: Make bdrv_filter_default_perms() static, Kevin Wolf, 2020/05/15
- [PULL 44/51] block: Drop child_file,
Kevin Wolf <=
- [PULL 45/51] block: Pass BdrvChildRole in remaining cases, Kevin Wolf, 2020/05/15
- [PULL 47/51] block/block-copy: Fix uninitialized variable in block_copy_task_entry, Kevin Wolf, 2020/05/15
- [PULL 49/51] iotests: log messages from notrun(), Kevin Wolf, 2020/05/15
- [PULL 50/51] hw/ide/ahci: Log lost IRQs, Kevin Wolf, 2020/05/15
- [PULL 51/51] iotests/030: Reduce run time by unthrottling job earlier, Kevin Wolf, 2020/05/15
- [PULL 48/51] block/block-copy: Simplify block_copy_do_copy(), Kevin Wolf, 2020/05/15
- Re: [PULL 00/51] Block layer patches, Peter Maydell, 2020/05/15
- Re: [PULL 00/51] Block layer patches, no-reply, 2020/05/15