[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 35/45] block: make bdrv_find_child() function public
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v5 35/45] block: make bdrv_find_child() function public |
Date: |
Thu, 31 Mar 2022 00:28:52 +0300 |
To be reused soon.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
---
block.c | 13 +++++++++++++
blockdev.c | 14 --------------
include/block/block_int-io.h | 1 +
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/block.c b/block.c
index 17c057a962..9e1be402e2 100644
--- a/block.c
+++ b/block.c
@@ -8039,6 +8039,19 @@ int bdrv_make_empty(BdrvChild *c, Error **errp)
return 0;
}
+BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, const char *child_name)
+{
+ BdrvChild *child;
+
+ QLIST_FOREACH(child, &parent_bs->children, next) {
+ if (strcmp(child->name, child_name) == 0) {
+ return child;
+ }
+ }
+
+ return NULL;
+}
+
/*
* Return the child that @bs acts as an overlay for, and from which data may be
* copied in COW or COR operations. Usually this is the backing file.
diff --git a/blockdev.c b/blockdev.c
index 3afd2ceea8..abd0600d15 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3672,20 +3672,6 @@ out:
tran_finalize(tran, ret);
}
-static BdrvChild *bdrv_find_child(BlockDriverState *parent_bs,
- const char *child_name)
-{
- BdrvChild *child;
-
- QLIST_FOREACH(child, &parent_bs->children, next) {
- if (strcmp(child->name, child_name) == 0) {
- return child;
- }
- }
-
- return NULL;
-}
-
void qmp_x_blockdev_change(const char *parent, bool has_child,
const char *child, bool has_node,
const char *node, Error **errp)
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index bb454200e5..0ce5eaf9a2 100644
--- a/include/block/block_int-io.h
+++ b/include/block/block_int-io.h
@@ -122,6 +122,7 @@ int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src,
int64_t src_offset,
int refresh_total_sectors(BlockDriverState *bs, int64_t hint);
+BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, const char
*child_name);
BdrvChild *bdrv_cow_child(BlockDriverState *bs);
BdrvChild *bdrv_filter_child(BlockDriverState *bs);
BdrvChild *bdrv_filter_or_cow_child(BlockDriverState *bs);
--
2.35.1
- [PATCH v5 11/45] Revert "block: Restructure remove_file_or_backing_child()", (continued)
- [PATCH v5 11/45] Revert "block: Restructure remove_file_or_backing_child()", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 17/45] block: drop bdrv_remove_filter_or_cow_child, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 16/45] block: drop bdrv_detach_child(), Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 18/45] block: bdrv_refresh_perms(): allow external tran, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 19/45] block: refactor bdrv_list_refresh_perms to allow any list of nodes, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 22/45] block: implemet bdrv_unref_tran(), Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 23/45] blockdev: refactor transaction to use Transaction API, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 26/45] blockdev: transaction: refactor handling transaction properties, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 25/45] blockdev: qmp_transaction: refactor loop to classic for, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 29/45] block: introduce BDRV_O_NOPERM flag, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 35/45] block: make bdrv_find_child() function public,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v5 36/45] block: bdrv_replace_child_bs(): move to external transaction, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 32/45] iotests: add blockdev-add-transaction, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 39/45] block: bdrv_get_xdbg_block_graph(): report export ids, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 44/45] block: bdrv_open_inherit: create BlockBackend only when necessary, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 07/45] block: document connection between child roles and bs->backing/bs->file, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 10/45] Revert "block: Let replace_child_tran keep indirect pointer", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 14/45] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 15/45] block: refactor bdrv_remove_file_or_backing_child to bdrv_remove_child, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 20/45] block: make permission update functions public, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 24/45] blockdev: transactions: rename some things, Vladimir Sementsov-Ogievskiy, 2022/03/30