aboutsummaryrefslogtreecommitdiff
path: root/block/blklogwrites.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2020-05-13 13:05:39 +0200
committerKevin Wolf <kwolf@redhat.com>2020-05-18 19:05:25 +0200
commit69dca43d6b6819b3d0895364692e2d0445674916 (patch)
treed5d337c1400c110d2714bf7012aef655e73db040 /block/blklogwrites.c
parenta16be3cdfce2379b5fb0a17a3017a6c59d73388d (diff)
block: Use bdrv_default_perms()
bdrv_default_perms() can decide which permission profile to use based on the BdrvChildRole, so block drivers do not need to select it explicitly. The blkverify driver now no longer shares the WRITE permission for the image to verify. We thus have to adjust two places in test-block-iothread not to take it. (Note that in theory, blkverify should behave like quorum in this regard and share neither WRITE nor RESIZE for both of its children. In practice, it does not really matter, because blkverify is used only for debugging, so we might as well keep its permissions rather liberal.) Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200513110544.176672-30-mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/blklogwrites.c')
-rw-r--r--block/blklogwrites.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/block/blklogwrites.c b/block/blklogwrites.c
index 3a57b273fc..8684fb1c74 100644
--- a/block/blklogwrites.c
+++ b/block/blklogwrites.c
@@ -295,13 +295,8 @@ static void blk_log_writes_child_perm(BlockDriverState *bs, BdrvChild *c,
return;
}
- if (!strcmp(c->name, "log")) {
- bdrv_format_default_perms(bs, c, child_class, role, ro_q, perm, shrd,
- nperm, nshrd);
- } else {
- bdrv_filter_default_perms(bs, c, child_class, role, ro_q, perm, shrd,
- nperm, nshrd);
- }
+ bdrv_default_perms(bs, c, child_class, role, ro_q, perm, shrd,
+ nperm, nshrd);
}
static void blk_log_writes_refresh_limits(BlockDriverState *bs, Error **errp)