[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/35] block: rename bdrv_replace_child to bdrv_replace_child_
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v3 01/35] block: rename bdrv_replace_child to bdrv_replace_child_tran |
Date: |
Tue, 1 Jun 2021 19:49:52 +0300 |
We have bdrv_replace_child() wrapper on bdrv_replace_child_noperm().
But bdrv_replace_child() doesn't update permissions. It's rather
strange, as normally it's expected that foo() should call foo_noperm()
and update permissions.
Let's rename and add comment.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
block.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/block.c b/block.c
index 0dc97281dc..3033c90666 100644
--- a/block.c
+++ b/block.c
@@ -2247,12 +2247,14 @@ static TransactionActionDrv bdrv_replace_child_drv = {
};
/*
- * bdrv_replace_child
+ * bdrv_replace_child_tran
*
* Note: real unref of old_bs is done only on commit.
+ *
+ * The function doesn't update permissions, caller is responsible for this.
*/
-static void bdrv_replace_child(BdrvChild *child, BlockDriverState *new_bs,
- Transaction *tran)
+static void bdrv_replace_child_tran(BdrvChild *child, BlockDriverState *new_bs,
+ Transaction *tran)
{
BdrvReplaceChildState *s = g_new(BdrvReplaceChildState, 1);
*s = (BdrvReplaceChildState) {
@@ -4750,7 +4752,7 @@ static void bdrv_remove_filter_or_cow_child_abort(void
*opaque)
}
/*
- * We don't have to restore child->bs here to undo bdrv_replace_child()
+ * We don't have to restore child->bs here to undo
bdrv_replace_child_tran()
* because that function is transactionable and it registered own
completion
* entries in @tran, so .abort() for bdrv_replace_child_safe() will be
* called automatically.
@@ -4786,7 +4788,7 @@ static void
bdrv_remove_filter_or_cow_child(BlockDriverState *bs,
}
if (child->bs) {
- bdrv_replace_child(child, NULL, tran);
+ bdrv_replace_child_tran(child, NULL, tran);
}
s = g_new(BdrvRemoveFilterOrCowChild, 1);
@@ -4826,7 +4828,7 @@ static int bdrv_replace_node_noperm(BlockDriverState
*from,
c->name, from->node_name);
return -EPERM;
}
- bdrv_replace_child(c, to, tran);
+ bdrv_replace_child_tran(c, to, tran);
}
return 0;
--
2.29.2
- [PATCH v3 00/35] block: publish backup-top filter, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 01/35] block: rename bdrv_replace_child to bdrv_replace_child_tran,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v3 02/35] block: comment graph-modifying function not updating permissions, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 03/35] block: introduce bdrv_replace_child_bs(), Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 09/35] block/block-copy: introduce block_copy_set_copy_opts(), Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 04/35] block: introduce blk_replace_bs, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 10/35] block/backup: set copy_range and compress after filter insertion, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 05/35] qdev-properties: PropertyInfo: add realized_set_allowed field, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 06/35] qdev: allow setting drive property for realized device, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 07/35] block: rename backup-top to copy-before-write, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 11/35] block/backup: move cluster size calculation to block-copy, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 08/35] block-copy: always set BDRV_REQ_SERIALISING flag, Vladimir Sementsov-Ogievskiy, 2021/06/01