[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 36/51] block: Drop child_backing
From: |
Kevin Wolf |
Subject: |
[PULL 36/51] block: Drop child_backing |
Date: |
Fri, 15 May 2020 14:45:06 +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 | 60 ++-------------------------------------
2 files changed, 3 insertions(+), 58 deletions(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 4b09fa1124..0781d43af5 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -742,7 +742,6 @@ struct BdrvChildClass {
extern const BdrvChildClass child_of_bds;
extern const BdrvChildClass child_file;
-extern const BdrvChildClass child_backing;
struct BdrvChild {
BlockDriverState *bs;
diff --git a/block.c b/block.c
index 131ae20ffc..d138a3c261 100644
--- a/block.c
+++ b/block.c
@@ -1215,15 +1215,6 @@ static void bdrv_backing_attach(BdrvChild *c)
parent->backing_blocker);
}
-/* XXX: Will be removed along with child_backing */
-static void bdrv_child_cb_attach_backing(BdrvChild *c)
-{
- if (!(c->role & BDRV_CHILD_COW)) {
- bdrv_backing_attach(c);
- }
- bdrv_child_cb_attach(c);
-}
-
static void bdrv_backing_detach(BdrvChild *c)
{
BlockDriverState *parent = c->opaque;
@@ -1234,28 +1225,6 @@ static void bdrv_backing_detach(BdrvChild *c)
parent->backing_blocker = NULL;
}
-/* XXX: Will be removed along with child_backing */
-static void bdrv_child_cb_detach_backing(BdrvChild *c)
-{
- if (!(c->role & BDRV_CHILD_COW)) {
- bdrv_backing_detach(c);
- }
- bdrv_child_cb_detach(c);
-}
-
-/*
- * Returns the options and flags that bs->backing should get, based on the
- * given options and flags for the parent BDS
- */
-static void bdrv_backing_options(BdrvChildRole role, bool parent_is_format,
- int *child_flags, QDict *child_options,
- int parent_flags, QDict *parent_options)
-{
- bdrv_inherited_options(BDRV_CHILD_COW, true,
- child_flags, child_options,
- parent_flags, parent_options);
-}
-
static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
const char *filename, Error **errp)
{
@@ -1283,21 +1252,6 @@ static int bdrv_backing_update_filename(BdrvChild *c,
BlockDriverState *base,
return ret;
}
-const BdrvChildClass child_backing = {
- .parent_is_bds = true,
- .get_parent_desc = bdrv_child_get_parent_desc,
- .attach = bdrv_child_cb_attach_backing,
- .detach = bdrv_child_cb_detach_backing,
- .inherit_options = bdrv_backing_options,
- .drained_begin = bdrv_child_cb_drained_begin,
- .drained_poll = bdrv_child_cb_drained_poll,
- .drained_end = bdrv_child_cb_drained_end,
- .inactivate = bdrv_child_cb_inactivate,
- .update_filename = bdrv_backing_update_filename,
- .can_set_aio_ctx = bdrv_child_cb_can_set_aio_ctx,
- .set_aio_ctx = bdrv_child_cb_set_aio_ctx,
-};
-
/*
* Returns the options and flags that a generic child of a BDS should
* get, based on the given options and flags for the parent BDS.
@@ -2446,8 +2400,7 @@ static void bdrv_default_perms_for_cow(BlockDriverState
*bs, BdrvChild *c,
uint64_t perm, uint64_t shared,
uint64_t *nperm, uint64_t *nshared)
{
- assert(child_class == &child_backing ||
- (child_class == &child_of_bds && (role & BDRV_CHILD_COW)));
+ assert(child_class == &child_of_bds && (role & BDRV_CHILD_COW));
/*
* We want consistent read from backing files if the parent needs it.
@@ -2566,23 +2519,16 @@ void bdrv_format_default_perms(BlockDriverState *bs,
BdrvChild *c,
uint64_t perm, uint64_t shared,
uint64_t *nperm, uint64_t *nshared)
{
- bool backing = (child_class == &child_backing);
-
if (child_class == &child_of_bds) {
bdrv_default_perms(bs, c, child_class, role, reopen_queue,
perm, shared, nperm, nshared);
return;
}
- assert(child_class == &child_backing || child_class == &child_file);
+ assert(child_class == &child_file);
- if (!backing) {
- bdrv_default_perms_for_storage(bs, c, child_class, role, reopen_queue,
- perm, shared, nperm, nshared);
- } else {
- bdrv_default_perms_for_cow(bs, c, child_class, role, reopen_queue,
+ bdrv_default_perms_for_storage(bs, c, child_class, role, reopen_queue,
perm, shared, nperm, nshared);
- }
}
void bdrv_default_perms(BlockDriverState *bs, BdrvChild *c,
--
2.25.4
- [PULL 29/51] block: Pull out bdrv_default_perms_for_storage(), (continued)
- [PULL 29/51] block: Pull out bdrv_default_perms_for_storage(), Kevin Wolf, 2020/05/15
- [PULL 21/51] block: Rename bdrv_inherited_options(), Kevin Wolf, 2020/05/15
- [PULL 24/51] block: Unify bdrv_child_cb_attach(), Kevin Wolf, 2020/05/15
- [PULL 30/51] block: Relax *perms_for_storage for data children, Kevin Wolf, 2020/05/15
- [PULL 31/51] block: Add bdrv_default_perms(), Kevin Wolf, 2020/05/15
- [PULL 32/51] raw-format: Split raw_read_options(), Kevin Wolf, 2020/05/15
- [PULL 34/51] block: Drop child_format, Kevin Wolf, 2020/05/15
- [PULL 33/51] block: Switch child_format users to child_of_bds, Kevin Wolf, 2020/05/15
- [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 <=
- [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, 2020/05/15
- [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