09.11.2020 10:04, Vladimir Sementsov-Ogievskiy wrote:
06.11.2020 18:14, Alberto Garcia wrote:
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 ?
Oops, yes I should
So, squash-in:
diff --git a/block.c b/block.c
index fc7633307f..a96dc07364 100644
--- a/block.c
+++ b/block.c
@@ -2328,7 +2328,8 @@ static int bdrv_refresh_perms(BlockDriverState *bs, bool
*tighten_restrictions,
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);
+ ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL,
+ tighten_restrictions, errp);
if (ret < 0) {
bdrv_abort_perm_update(bs);
return ret;
(produces simple conflict when applying "block: drop tighten_restrictions")
--
Best regards,
Vladimir