[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 31/33] block: Drop child_file
From: |
Max Reitz |
Subject: |
[PATCH v3 31/33] block: Drop child_file |
Date: |
Tue, 18 Feb 2020 13:42:40 +0100 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block.c | 30 +-----------------------------
include/block/block_int.h | 1 -
tests/test-bdrv-drain.c | 8 +++-----
3 files changed, 4 insertions(+), 35 deletions(-)
diff --git a/block.c b/block.c
index 16eb790ea6..986f99415c 100644
--- a/block.c
+++ b/block.c
@@ -1121,33 +1121,6 @@ const BdrvChildClass child_of_bds = {
.update_filename = bdrv_child_cb_update_filename,
};
-/*
- * 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;
@@ -2278,8 +2251,7 @@ static void
bdrv_default_perms_for_metadata(BlockDriverState *bs, BdrvChild *c,
{
int flags;
- assert(child_class == &child_file ||
- (child_class == &child_of_bds && (role & BDRV_CHILD_METADATA)));
+ assert(child_class == &child_of_bds && (role & BDRV_CHILD_METADATA));
flags = bdrv_reopen_get_flags(reopen_queue, bs);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 28a35cd5d1..1609e40b58 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/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.24.1
- [PATCH v3 21/33] block: Drop child_format, (continued)
- [PATCH v3 21/33] block: Drop child_format, Max Reitz, 2020/02/18
- [PATCH v3 22/33] block: Make backing files child_of_bds children, Max Reitz, 2020/02/18
- [PATCH v3 24/33] block: Make format drivers use child_of_bds, Max Reitz, 2020/02/18
- [PATCH v3 23/33] block: Drop child_backing, Max Reitz, 2020/02/18
- [PATCH v3 25/33] block: Make filter drivers use child_of_bds, Max Reitz, 2020/02/18
- [PATCH v3 26/33] block: Use child_of_bds in remaining places, Max Reitz, 2020/02/18
- [PATCH v3 27/33] tests: Use child_of_bds instead of child_file, Max Reitz, 2020/02/18
- [PATCH v3 29/33] block: Make bdrv_filter_default_perms() static, Max Reitz, 2020/02/18
- [PATCH v3 28/33] block: Use bdrv_default_perms(), Max Reitz, 2020/02/18
- [PATCH v3 30/33] block: Drop bdrv_format_default_perms(), Max Reitz, 2020/02/18
- [PATCH v3 31/33] block: Drop child_file,
Max Reitz <=
- [PATCH v3 32/33] block: Pass BdrvChildRole in remaining cases, Max Reitz, 2020/02/18
- [PATCH v3 33/33] block: Drop @child_class from bdrv_child_perm(), Max Reitz, 2020/02/18