block: move supports_backing check to bdrv_set_file_or_backing_noperm()

Move supports_backing check of bdrv_reopen_parse_backing to called
(through bdrv_set_backing_noperm()) bdrv_set_file_or_backing_noperm()
function. The check applies to general case, so it's appropriate for
bdrv_set_file_or_backing_noperm().

We have to declare backing support for two test drivers, otherwise new
check fails.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210610120537.196183-7-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2021-06-10 15:05:34 +03:00 committed by Kevin Wolf
parent cbfdb98ce2
commit 25f78d9e2d
3 changed files with 17 additions and 14 deletions

View file

@ -95,6 +95,7 @@ static int bdrv_test_change_backing_file(BlockDriverState *bs,
static BlockDriver bdrv_test = {
.format_name = "test",
.instance_size = sizeof(BDRVTestState),
.supports_backing = true,
.bdrv_close = bdrv_test_close,
.bdrv_co_preadv = bdrv_test_co_preadv,

View file

@ -41,6 +41,7 @@ static void no_perm_default_perms(BlockDriverState *bs, BdrvChild *c,
static BlockDriver bdrv_no_perm = {
.format_name = "no-perm",
.supports_backing = true,
.bdrv_child_perm = no_perm_default_perms,
};