On 2/4/20 11:08 AM, Max Reitz wrote:
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 <mre...@redhat.com>
---
+++ 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);
}
I like the consolidation this is making possible.
The commit note on test-block-iothread was important, and makes sense.
Reviewed-by: Eric Blake <ebl...@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org