[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 3/9] block: bdrv_reopen_parse_backing(): don't check aio conte
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v5 3/9] block: bdrv_reopen_parse_backing(): don't check aio context |
Date: |
Sat, 15 May 2021 16:46:59 +0300 |
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>
---
block.c | 33 ---------------------------------
1 file changed, 33 deletions(-)
diff --git a/block.c b/block.c
index 5141c04815..4e18bc3177 100644
--- a/block.c
+++ b/block.c
@@ -4190,29 +4190,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.
@@ -4264,16 +4241,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.29.2
- [PATCH v5 0/9] Allow changing bs->file on reopen, Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 2/9] block: introduce bdrv_set_file_or_backing_noperm(), Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 1/9] block: introduce bdrv_remove_file_or_backing_child(), Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 3/9] block: bdrv_reopen_parse_backing(): don't check aio context,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v5 4/9] block: bdrv_reopen_parse_backing(): don't check frozen child, Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 5/9] block: bdrv_reopen_parse_backing(): simplify handling implicit filters, Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 6/9] block: move supports_backing check to bdrv_set_file_or_backing_noperm(), Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 7/9] block: BDRVReopenState: drop replace_backing_bs field, Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 8/9] block: Allow changing bs->file on reopen, Vladimir Sementsov-Ogievskiy, 2021/05/15
- [PATCH v5 9/9] iotests: Test replacing files with x-blockdev-reopen, Vladimir Sementsov-Ogievskiy, 2021/05/15
- Re: [PATCH v5 0/9] Allow changing bs->file on reopen, Vladimir Sementsov-Ogievskiy, 2021/05/15