[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/30] block: bdrv_child_set_perm() drop redundant parameters.
From: |
Max Reitz |
Subject: |
[PULL 03/30] block: bdrv_child_set_perm() drop redundant parameters. |
Date: |
Fri, 18 Dec 2020 16:12:22 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
We must set the permission used for _check_. Assert that we have
backup and drop extra arguments.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201106124241.16950-7-vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/block.c b/block.c
index 66ab6caa7d..f66388b9ea 100644
--- a/block.c
+++ b/block.c
@@ -1903,7 +1903,7 @@ static int bdrv_child_check_perm(BdrvChild *c,
BlockReopenQueue *q,
GSList *ignore_children,
bool *tighten_restrictions, Error **errp);
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_set_perm(BdrvChild *c);
typedef struct BlockReopenQueueEntry {
bool prepared;
@@ -2137,11 +2137,7 @@ static void bdrv_set_perm(BlockDriverState *bs)
/* Update all children */
QLIST_FOREACH(c, &bs->children, next) {
- uint64_t cur_perm, cur_shared;
- bdrv_child_perm(bs, c->bs, c, c->role, NULL,
- cumulative_perms, cumulative_shared_perms,
- &cur_perm, &cur_shared);
- bdrv_child_set_perm(c, cur_perm, cur_shared);
+ bdrv_child_set_perm(c);
}
}
@@ -2304,13 +2300,10 @@ static int bdrv_child_check_perm(BdrvChild *c,
BlockReopenQueue *q,
return 0;
}
-static void bdrv_child_set_perm(BdrvChild *c, uint64_t perm, uint64_t shared)
+static void bdrv_child_set_perm(BdrvChild *c)
{
c->has_backup_perm = false;
- c->perm = perm;
- c->shared_perm = shared;
-
bdrv_set_perm(c->bs);
}
@@ -2369,7 +2362,7 @@ int bdrv_child_try_set_perm(BdrvChild *c, uint64_t perm,
uint64_t shared,
return ret;
}
- bdrv_child_set_perm(c, perm, shared);
+ bdrv_child_set_perm(c);
return 0;
}
--
2.29.2
- [PULL 00/30] Block patches, Max Reitz, 2020/12/18
- [PULL 01/30] block: add bdrv_refresh_perms() helper, Max Reitz, 2020/12/18
- [PULL 03/30] block: bdrv_child_set_perm() drop redundant parameters.,
Max Reitz <=
- [PULL 02/30] block: bdrv_set_perm() drop redundant parameters., Max Reitz, 2020/12/18
- [PULL 04/30] block: drop tighten_restrictions, Max Reitz, 2020/12/18
- [PULL 06/30] block/io.c: drop assertion on double waiting for request serialisation, Max Reitz, 2020/12/18
- [PULL 07/30] block/io: split out bdrv_find_conflicting_request, Max Reitz, 2020/12/18
- [PULL 08/30] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg, Max Reitz, 2020/12/18
- [PULL 09/30] block: bdrv_mark_request_serialising: split non-waiting function, Max Reitz, 2020/12/18
- [PULL 11/30] block: bdrv_check_perm(): process children anyway, Max Reitz, 2020/12/18
- [PULL 05/30] block: simplify comment to BDRV_REQ_SERIALISING, Max Reitz, 2020/12/18
- [PULL 10/30] block: introduce BDRV_REQ_NO_WAIT flag, Max Reitz, 2020/12/18
- [PULL 14/30] iotests: qemu_io_silent: support --image-opts, Max Reitz, 2020/12/18