qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v14 03/20] block: Respect "force-shared-write" i


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v14 03/20] block: Respect "force-shared-write" in perm propagating
Date: Fri, 21 Apr 2017 10:38:46 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 21.04.2017 um 05:55 hat Fam Zheng geschrieben:
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  block.c | 31 +++++++++++++++++++++++--------
>  1 file changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/block.c b/block.c
> index f5c4e97..6acf618 100644
> --- a/block.c
> +++ b/block.c
> @@ -1422,6 +1422,21 @@ static int bdrv_child_check_perm(BdrvChild *c, 
> uint64_t perm, uint64_t shared,
>  static void bdrv_child_abort_perm_update(BdrvChild *c);
>  static void bdrv_child_set_perm(BdrvChild *c, uint64_t perm, uint64_t 
> shared);
>  
> +static void bdrv_child_perm(BlockDriverState *bs, BdrvChild *c,
> +                            const BdrvChildRole *role,
> +                            uint64_t parent_perm, uint64_t parent_shared,
> +                            uint64_t *nperm, uint64_t *nshared)
> +{
> +    if (bs->drv && bs->drv->bdrv_child_perm) {
> +        bs->drv->bdrv_child_perm(bs, c, role,
> +                                 parent_perm, parent_shared,
> +                                 nperm, nshared);
> +    }
> +    if (bs->force_shared_write) {

As discussed on IRC, this should be c->bs->force_shared_write, so that
the option set for a given node refers to all BdrvChild objects pointing
to that node, not to all children of the node.

This means that if you configure this manually and you just want to get
rid of the file locking, setting force-shared-write = true for the
file-posix node is enough (without the change you would have to set it
for all parents of the file-posix node).

> +        *nshared |= BLK_PERM_WRITE;
> +    }
> +}

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]