[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/24] block: bdrv_reopen_parse_backing(): don't check aio context
From: |
Kevin Wolf |
Subject: |
[PULL 08/24] block: bdrv_reopen_parse_backing(): don't check aio context |
Date: |
Wed, 30 Jun 2021 18:01:50 +0200 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
We don't need this check: bdrv_set_backing_noperm() will do it anyway
(actually in bdrv_attach_child_common()).
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210610120537.196183-4-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 33 ---------------------------------
1 file changed, 33 deletions(-)
diff --git a/block.c b/block.c
index 14711ce7ab..69dc9d188d 100644
--- a/block.c
+++ b/block.c
@@ -4215,29 +4215,6 @@ int bdrv_reopen_set_read_only(BlockDriverState *bs, bool
read_only,
return ret;
}
-static bool bdrv_reopen_can_attach(BlockDriverState *parent,
- BdrvChild *child,
- BlockDriverState *new_child,
- Error **errp)
-{
- AioContext *parent_ctx = bdrv_get_aio_context(parent);
- AioContext *child_ctx = bdrv_get_aio_context(new_child);
- GSList *ignore;
- bool ret;
-
- ignore = g_slist_prepend(NULL, child);
- ret = bdrv_can_set_aio_context(new_child, parent_ctx, &ignore, NULL);
- g_slist_free(ignore);
- if (ret) {
- return ret;
- }
-
- ignore = g_slist_prepend(NULL, child);
- ret = bdrv_can_set_aio_context(parent, child_ctx, &ignore, errp);
- g_slist_free(ignore);
- return ret;
-}
-
/*
* Take a BDRVReopenState and check if the value of 'backing' in the
* reopen_state->options QDict is valid or not.
@@ -4289,16 +4266,6 @@ static int bdrv_reopen_parse_backing(BDRVReopenState
*reopen_state,
g_assert_not_reached();
}
- /*
- * Check AioContext compatibility so that the bdrv_set_backing_hd() call in
- * bdrv_reopen_commit() won't fail.
- */
- if (new_backing_bs) {
- if (!bdrv_reopen_can_attach(bs, bs->backing, new_backing_bs, errp)) {
- return -EINVAL;
- }
- }
-
/*
* Ensure that @bs can really handle backing files, because we are
* about to give it one (or swap the existing one)
--
2.31.1
- [PULL 00/24] Block layer patches, Kevin Wolf, 2021/06/30
- [PULL 01/24] Prevent compiler warning on block.c, Kevin Wolf, 2021/06/30
- [PULL 03/24] block: BDRV_O_NO_IO for backing file on creation, Kevin Wolf, 2021/06/30
- [PULL 02/24] block: Move read-only check during truncation earlier, Kevin Wolf, 2021/06/30
- [PULL 06/24] block: introduce bdrv_remove_file_or_backing_child(), Kevin Wolf, 2021/06/30
- [PULL 08/24] block: bdrv_reopen_parse_backing(): don't check aio context,
Kevin Wolf <=
- [PULL 07/24] block: introduce bdrv_set_file_or_backing_noperm(), Kevin Wolf, 2021/06/30
- [PULL 12/24] block: BDRVReopenState: drop replace_backing_bs field, Kevin Wolf, 2021/06/30
- [PULL 09/24] block: bdrv_reopen_parse_backing(): don't check frozen child, Kevin Wolf, 2021/06/30
- [PULL 10/24] block: bdrv_reopen_parse_backing(): simplify handling implicit filters, Kevin Wolf, 2021/06/30
- [PULL 11/24] block: move supports_backing check to bdrv_set_file_or_backing_noperm(), Kevin Wolf, 2021/06/30
- [PULL 13/24] block: Allow changing bs->file on reopen, Kevin Wolf, 2021/06/30
- [PULL 04/24] block: rename bdrv_replace_child to bdrv_replace_child_tran, Kevin Wolf, 2021/06/30
- [PULL 17/24] block/ssh: add support for sha256 host key fingerprints, Kevin Wolf, 2021/06/30
- [PULL 15/24] introduce QEMU_AUTO_VFREE, Kevin Wolf, 2021/06/30
- [PULL 18/24] vhost: Add Error parameter to vhost_dev_init(), Kevin Wolf, 2021/06/30