[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 03/21] block: Drop bdrv_is_first_non_filter()
From: |
Max Reitz |
Subject: |
[PATCH v3 03/21] block: Drop bdrv_is_first_non_filter() |
Date: |
Thu, 30 Jan 2020 22:44:13 +0100 |
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>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block.c | 26 --------------------------
include/block/block.h | 1 -
2 files changed, 27 deletions(-)
diff --git a/block.c b/block.c
index 99ce26d64d..6f58a4900f 100644
--- a/block.c
+++ b/block.c
@@ -6212,32 +6212,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)
{
diff --git a/include/block/block.h b/include/block/block.h
index e9dcfef7fa..8f6a0cad9c 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -404,7 +404,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,
--
2.24.1
- [PATCH v3 00/21] block: Fix check_to_replace_node(), Max Reitz, 2020/01/30
- [PATCH v3 02/21] blockdev: Allow resizing everywhere, Max Reitz, 2020/01/30
- [PATCH v3 01/21] blockdev: Allow external snapshots everywhere, Max Reitz, 2020/01/30
- [PATCH v3 04/21] iotests: Let 041 use -blockdev for quorum children, Max Reitz, 2020/01/30
- [PATCH v3 03/21] block: Drop bdrv_is_first_non_filter(),
Max Reitz <=
- [PATCH v3 05/21] quorum: Fix child permissions, Max Reitz, 2020/01/30
- [PATCH v3 07/21] blkverify: Implement .bdrv_recurse_can_replace(), Max Reitz, 2020/01/30
- [PATCH v3 06/21] block: Add bdrv_recurse_can_replace(), Max Reitz, 2020/01/30
- [PATCH v3 08/21] quorum: Store children in own structure, Max Reitz, 2020/01/30
- [PATCH v3 09/21] quorum: Add QuorumChild.to_be_replaced, Max Reitz, 2020/01/30
- [PATCH v3 10/21] quorum: Implement .bdrv_recurse_can_replace(), Max Reitz, 2020/01/30
- [PATCH v3 11/21] block: Use bdrv_recurse_can_replace(), Max Reitz, 2020/01/30
- [PATCH v3 12/21] block: Remove bdrv_recurse_is_first_non_filter(), Max Reitz, 2020/01/30
- [PATCH v3 13/21] mirror: Double-check immediately before replacing, Max Reitz, 2020/01/30
- [PATCH v3 14/21] quorum: Stop marking it as a filter, Max Reitz, 2020/01/30