From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com,
hreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com,
den@openvz.org, nshirokovskiy@virtuozzo.com, yur@virtuozzo.com,
dim@virtuozzo.com, igor@virtuozzo.com, pkrempa@redhat.com,
libvir-list@redhat.com, stefanha@redhat.com
Subject: [PATCH v2 3/4] block: make bdrv_find_child() function public
Date: Wed, 22 Dec 2021 17:02:53 +0100 [thread overview]
Message-ID: <20211222160254.226909-4-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20211222160254.226909-1-vsementsov@virtuozzo.com>
To be reused soon.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
include/block/block_int.h | 1 +
block.c | 13 +++++++++++++
blockdev.c | 14 --------------
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index f4c75e8ba9..79bdde8bf4 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -1433,6 +1433,7 @@ BdrvDirtyBitmap *block_dirty_bitmap_remove(const char *node, const char *name,
BlockDriverState **bitmap_bs,
Error **errp);
+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);
diff --git a/block.c b/block.c
index 0ac5b163d2..840d52e7c8 100644
--- a/block.c
+++ b/block.c
@@ -7727,6 +7727,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 0eb2823b1b..ce23059d5e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3644,20 +3644,6 @@ out:
aio_context_release(aio_context);
}
-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)
--
2.31.1
next prev parent reply other threads:[~2021-12-22 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 16:02 [PATCH RFC v2 0/4] blockdev-replace Vladimir Sementsov-Ogievskiy
2021-12-22 16:02 ` [PATCH v2 1/4] block-backend: blk_root(): drop const specifier on return type Vladimir Sementsov-Ogievskiy
2021-12-22 16:02 ` [PATCH v2 2/4] block/export: add blk_by_export_id() Vladimir Sementsov-Ogievskiy
2021-12-22 16:02 ` Vladimir Sementsov-Ogievskiy [this message]
2021-12-22 16:02 ` [PATCH v2 4/4] qapi: add blockdev-replace command Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211222160254.226909-4-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=dim@virtuozzo.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=igor@virtuozzo.com \
--cc=kwolf@redhat.com \
--cc=libvir-list@redhat.com \
--cc=nshirokovskiy@virtuozzo.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=yur@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).