diff options
-rw-r--r-- | block.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1680,10 +1680,16 @@ BdrvChild *bdrv_attach_child(BlockDriverState *parent_bs, Error **errp) { BdrvChild *child; + uint64_t perm, shared_perm; + + bdrv_get_cumulative_perm(parent_bs, &perm, &shared_perm); + + assert(parent_bs->drv); + parent_bs->drv->bdrv_child_perm(parent_bs, NULL, child_role, + perm, shared_perm, &perm, &shared_perm); - /* FIXME Use real permissions */ child = bdrv_root_attach_child(child_bs, child_name, child_role, - 0, BLK_PERM_ALL, parent_bs, errp); + perm, shared_perm, parent_bs, errp); if (child == NULL) { return NULL; } |