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 <vsement...@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