aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2022-10-25 04:49:47 -0400
committerKevin Wolf <kwolf@redhat.com>2022-10-27 20:14:11 +0200
commit27633e740e784709f256f6ee70f2dd0b5a87279f (patch)
tree544ba83d2e48a6ceac1209a86970c7b2f2f43b6e /block.c
parent3428b100dc65dbce3e3b646df471a8fb2a5df556 (diff)
block: implement .change_aio_ctx in child_of_bds
bdrv_child_cb_change_aio_ctx() is identical to bdrv_child_cb_can_set_aio_ctx(), as we only need to recursively go on the parent bs. Note: bdrv_child_try_change_aio_context() is not called by anyone at this point. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20221025084952.2139888-6-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block.c b/block.c
index 59319d9b0f..3386457083 100644
--- a/block.c
+++ b/block.c
@@ -1242,6 +1242,14 @@ static int bdrv_child_cb_inactivate(BdrvChild *child)
return 0;
}
+static bool bdrv_child_cb_change_aio_ctx(BdrvChild *child, AioContext *ctx,
+ GHashTable *visited, Transaction *tran,
+ Error **errp)
+{
+ BlockDriverState *bs = child->opaque;
+ return bdrv_change_aio_context(bs, ctx, visited, tran, errp);
+}
+
static bool bdrv_child_cb_can_set_aio_ctx(BdrvChild *child, AioContext *ctx,
GSList **ignore, Error **errp)
{
@@ -1534,6 +1542,7 @@ const BdrvChildClass child_of_bds = {
.inactivate = bdrv_child_cb_inactivate,
.can_set_aio_ctx = bdrv_child_cb_can_set_aio_ctx,
.set_aio_ctx = bdrv_child_cb_set_aio_ctx,
+ .change_aio_ctx = bdrv_child_cb_change_aio_ctx,
.update_filename = bdrv_child_cb_update_filename,
.get_parent_aio_context = child_of_bds_get_parent_aio_context,
};