[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 22/54] block: Request real permissions in bdrv_a
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH 22/54] block: Request real permissions in bdrv_attach_child() |
Date: |
Mon, 27 Feb 2017 15:10:17 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 22.02.2017 um 15:31 hat Max Reitz geschrieben:
> On 21.02.2017 15:58, Kevin Wolf wrote:
> > Now that all block drivers with children tell us what permissions they
> > need from each of their children, bdrv_attach_child() can use this
> > information and make the right requirements while trying to attach new
> > children.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > ---
> > block.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/block.c b/block.c
> > index 1c5f211..054e6f0 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -1659,10 +1659,14 @@ BdrvChild *bdrv_attach_child(BlockDriverState
> > *parent_bs,
> > Error **errp)
> > {
> > BdrvChild *child;
> > + uint64_t perm, shared_perm;
> > +
> > + assert(parent_bs->drv);
> > + parent_bs->drv->bdrv_child_perm(parent_bs, NULL, child_role,
> > + 0, BLK_PERM_ALL, &perm, &shared_perm);
>
> Another Second Thoughtâ„¢: Why do we request no permissions for the new
> child here? Seems weird to me. Shouldn't the caller specify the
> necessary permissions and what can be shared?
Actually not the caller, but we should calculate the cumulative
permissions of parent_bs, like in bdrv_update_perm().
Kevin
pgpwnB66d1C4x.pgp
Description: PGP signature
- Re: [Qemu-block] [PATCH 18/54] block: Default .bdrv_child_perm() for format drivers, (continued)
- [Qemu-block] [PATCH 17/54] block: Request child permissions in filter drivers, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 19/54] block: Request child permissions in format drivers, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 20/54] vvfat: Implement .bdrv_child_perm(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 22/54] block: Request real permissions in bdrv_attach_child(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 21/54] block: Require .bdrv_child_perm() with child nodes, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 23/54] block: Add permissions to BlockBackend, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 27/54] block: Request real permissions in blk_new_open(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 24/54] block: Add permissions to blk_new(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 25/54] block: Add error parameter to blk_insert_bs(), Kevin Wolf, 2017/02/21