From 25f78d9e2de528473d52acfcf7acdfb64e3453d4 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Thu, 10 Jun 2021 15:05:34 +0300 Subject: 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 Message-Id: <20210610120537.196183-7-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- tests/unit/test-bdrv-drain.c | 1 + tests/unit/test-bdrv-graph-mod.c | 1 + 2 files changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c index 892f7f47d8..ce071b5fc5 100644 --- a/tests/unit/test-bdrv-drain.c +++ b/tests/unit/test-bdrv-drain.c @@ -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, diff --git a/tests/unit/test-bdrv-graph-mod.c b/tests/unit/test-bdrv-graph-mod.c index 88f25c0cdb..a6e3bb79be 100644 --- a/tests/unit/test-bdrv-graph-mod.c +++ b/tests/unit/test-bdrv-graph-mod.c @@ -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, }; -- cgit v1.2.3-55-g7522