[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/22] block: Drop bdrv_is_first_non_filter()
From: |
Max Reitz |
Subject: |
[PATCH 03/22] block: Drop bdrv_is_first_non_filter() |
Date: |
Fri, 20 Sep 2019 17:27:45 +0200 |
It is unused now. (And it was ugly because it needed to explore all BDS
chains from the top.)
Signed-off-by: Max Reitz <address@hidden>
---
include/block/block.h | 1 -
block.c | 26 --------------------------
2 files changed, 27 deletions(-)
diff --git a/include/block/block.h b/include/block/block.h
index 37c9de7446..d3ccab4722 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -403,7 +403,6 @@ int bdrv_amend_options(BlockDriverState *bs_new, QemuOpts
*opts,
/* external snapshots */
bool bdrv_recurse_is_first_non_filter(BlockDriverState *bs,
BlockDriverState *candidate);
-bool bdrv_is_first_non_filter(BlockDriverState *candidate);
/* check if a named node can be replaced when doing drive-mirror */
BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
diff --git a/block.c b/block.c
index 1c7c199849..7d99ca692c 100644
--- a/block.c
+++ b/block.c
@@ -6206,32 +6206,6 @@ bool bdrv_recurse_is_first_non_filter(BlockDriverState
*bs,
return false;
}
-/* This function checks if the candidate is the first non filter bs down it's
- * bs chain. Since we don't have pointers to parents it explore all bs chains
- * from the top. Some filters can choose not to pass down the recursion.
- */
-bool bdrv_is_first_non_filter(BlockDriverState *candidate)
-{
- BlockDriverState *bs;
- BdrvNextIterator it;
-
- /* walk down the bs forest recursively */
- for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
- bool perm;
-
- /* try to recurse in this top level bs */
- perm = bdrv_recurse_is_first_non_filter(bs, candidate);
-
- /* candidate is the first non filter */
- if (perm) {
- bdrv_next_cleanup(&it);
- return true;
- }
- }
-
- return false;
-}
-
BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
const char *node_name, Error **errp)
{
--
2.21.0
- [PATCH 00/22] block: Fix check_to_replace_node(), Max Reitz, 2019/09/20
- [PATCH 01/22] blockdev: Allow external snapshots everywhere, Max Reitz, 2019/09/20
- [PATCH 02/22] blockdev: Allow resizing everywhere, Max Reitz, 2019/09/20
- [PATCH 03/22] block: Drop bdrv_is_first_non_filter(),
Max Reitz <=
- [PATCH 04/22] iotests: Let 041 use -blockdev for quorum children, Max Reitz, 2019/09/20
- [PATCH 05/22] quorum: Fix child permissions, Max Reitz, 2019/09/20
- [PATCH 07/22] blkverify: Implement .bdrv_recurse_can_replace(), Max Reitz, 2019/09/20
- [PATCH 09/22] quorum: Add QuorumChild.to_be_replaced, Max Reitz, 2019/09/20