[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-5.0 21/31] block: Drop child_backing
From: |
Max Reitz |
Subject: |
[PATCH for-5.0 21/31] block: Drop child_backing |
Date: |
Wed, 27 Nov 2019 14:16:14 +0100 |
Signed-off-by: Max Reitz <address@hidden>
---
block.c | 62 +++------------------------------------
include/block/block_int.h | 1 -
2 files changed, 4 insertions(+), 59 deletions(-)
diff --git a/block.c b/block.c
index 63fe19fd73..0530c81c6d 100644
--- a/block.c
+++ b/block.c
@@ -1147,15 +1147,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;
@@ -1166,28 +1157,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,
- int *child_flags, QDict *child_options,
- int parent_flags, QDict *parent_options)
-{
- bdrv_inherited_options(BDRV_CHILD_COW,
- child_flags, child_options,
- parent_flags, parent_options);
-}
-
static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
const char *filename, Error **errp)
{
@@ -1215,21 +1184,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,
-};
-
static int bdrv_open_flags(BlockDriverState *bs, int flags)
{
int open_flags = flags;
@@ -2235,8 +2189,7 @@ static void
bdrv_default_perms_for_backing(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.
@@ -2348,23 +2301,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_metadata(bs, c, child_class, role, reopen_queue,
- perm, shared, nperm, nshared);
- } else {
- bdrv_default_perms_for_backing(bs, c, child_class, role, reopen_queue,
- perm, shared, nperm, nshared);
- }
+ bdrv_default_perms_for_metadata(bs, c, child_class, role, reopen_queue,
+ perm, shared, nperm, nshared);
}
void bdrv_default_perms(BlockDriverState *bs, BdrvChild *c,
diff --git a/include/block/block_int.h b/include/block/block_int.h
index fe6206b210..895bcf4d30 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -731,7 +731,6 @@ struct BdrvChildClass {
extern const BdrvChildClass child_of_bds;
extern const BdrvChildClass child_file;
-extern const BdrvChildClass child_backing;
struct BdrvChild {
BlockDriverState *bs;
--
2.23.0
- [PATCH for-5.0 09/31] block: Unify bdrv_child_cb_attach(), (continued)
- [PATCH for-5.0 09/31] block: Unify bdrv_child_cb_attach(), Max Reitz, 2019/11/27
- [PATCH for-5.0 11/31] block: Add child_of_bds, Max Reitz, 2019/11/27
- [PATCH for-5.0 10/31] block: Unify bdrv_child_cb_detach(), Max Reitz, 2019/11/27
- [PATCH for-5.0 15/31] block: Split bdrv_default_perms_for_storage(), Max Reitz, 2019/11/27
- [PATCH for-5.0 13/31] block: Pull out bdrv_default_perms_for_backing(), Max Reitz, 2019/11/27
- [PATCH for-5.0 14/31] block: Pull out bdrv_default_perms_for_storage(), Max Reitz, 2019/11/27
- [PATCH for-5.0 16/31] block: Add bdrv_default_perms(), Max Reitz, 2019/11/27
- [PATCH for-5.0 17/31] raw-format: Split raw_read_options(), Max Reitz, 2019/11/27
- [PATCH for-5.0 19/31] block: Drop child_format, Max Reitz, 2019/11/27
- [PATCH for-5.0 20/31] block: Make backing files child_of_bds children, Max Reitz, 2019/11/27
- [PATCH for-5.0 21/31] block: Drop child_backing,
Max Reitz <=
- [PATCH for-5.0 23/31] block: Make filter drivers use child_of_bds, Max Reitz, 2019/11/27
- [PATCH for-5.0 22/31] block: Make format drivers use child_of_bds, Max Reitz, 2019/11/27
- [PATCH for-5.0 24/31] block: Use child_of_bds in remaining places, Max Reitz, 2019/11/27
- [PATCH for-5.0 25/31] tests: Use child_of_bds instead of child_file, Max Reitz, 2019/11/27
- [PATCH for-5.0 27/31] block: Make bdrv_filter_default_perms() static, Max Reitz, 2019/11/27
- [PATCH for-5.0 26/31] block: Use bdrv_default_perms(), Max Reitz, 2019/11/27
- [PATCH for-5.0 28/31] block: Drop bdrv_format_default_perms(), Max Reitz, 2019/11/27
- [PATCH for-5.0 31/31] block: Drop @child_class from bdrv_child_perm(), Max Reitz, 2019/11/27
- [PATCH for-5.0 30/31] block: Pass BdrvChildRole in remaining cases, Max Reitz, 2019/11/27
- [PATCH for-5.0 29/31] block: Drop child_file, Max Reitz, 2019/11/27