[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/7] block: add bdrv_refresh_perms() helper
From: |
Alberto Garcia |
Subject: |
Re: [PATCH v2 4/7] block: add bdrv_refresh_perms() helper |
Date: |
Fri, 06 Nov 2020 16:14:18 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Fri 06 Nov 2020 01:42:38 PM CET, Vladimir Sementsov-Ogievskiy wrote:
> Make separate function for common pattern.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block.c | 60 ++++++++++++++++++++++++++++-----------------------------
> 1 file changed, 30 insertions(+), 30 deletions(-)
>
> diff --git a/block.c b/block.c
> index 77a3f8f1e2..fc7633307f 100644
> --- a/block.c
> +++ b/block.c
> @@ -2321,6 +2321,23 @@ static void bdrv_child_abort_perm_update(BdrvChild *c)
> bdrv_abort_perm_update(c->bs);
> }
>
> +static int bdrv_refresh_perms(BlockDriverState *bs, bool
> *tighten_restrictions,
> + Error **errp)
> +{
> + int ret;
> + uint64_t perm, shared_perm;
> +
> + bdrv_get_cumulative_perm(bs, &perm, &shared_perm);
> + ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL,
> errp);
Aren't you supposed to pass tighten_restrictions here ?
Berto
- [PATCH v2 0/7] block: permission update fix & refactor, Vladimir Sementsov-Ogievskiy, 2020/11/06
- [PATCH v2 1/7] block: add forgotten bdrv_abort_perm_update() to bdrv_co_invalidate_cache(), Vladimir Sementsov-Ogievskiy, 2020/11/06
- [PATCH v2 5/7] block: bdrv_set_perm() drop redundant parameters., Vladimir Sementsov-Ogievskiy, 2020/11/06
- [PATCH v2 2/7] block: add bdrv_replace_node_common(), Vladimir Sementsov-Ogievskiy, 2020/11/06
- [PATCH v2 6/7] block: bdrv_child_set_perm() drop redundant parameters., Vladimir Sementsov-Ogievskiy, 2020/11/06