diff mbox series

[v2,6/7] block: bdrv_child_set_perm() drop redundant parameters.

Message ID 20201106124241.16950-7-vsementsov@virtuozzo.com
State Accepted
Commit 6e0c916cc8f171ec69148d8e35d4435f14a5f9b6
Headers show
Series block: permission update fix & refactor | expand

Commit Message

Vladimir Sementsov-Ogievskiy Nov. 6, 2020, 12:42 p.m. UTC
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>
---
 block.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

Comments

Max Reitz Nov. 9, 2020, 12:41 p.m. UTC | #1
On 06.11.20 13:42, Vladimir Sementsov-Ogievskiy wrote:
> 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>
> ---
>   block.c | 15 ++++-----------
>   1 file changed, 4 insertions(+), 11 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox series

Patch

diff --git a/block.c b/block.c
index b61d20252f..b44db05d14 100644
--- a/block.c
+++ b/block.c
@@ -1897,7 +1897,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;
@@ -2131,11 +2131,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);
     }
 }
 
@@ -2298,13 +2294,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);
 }
 
@@ -2362,7 +2355,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;
 }