diff options
author | Vladimir Sementsov-Ogievskiy | 2021-04-28 17:17:33 +0200 |
---|---|---|
committer | Kevin Wolf | 2021-04-30 12:27:47 +0200 |
commit | 3ca1f3225727419ba573673b744edac10904276f (patch) | |
tree | c9ccb7efa7c538152103bf670db977b8820118dd /block | |
parent | block: bdrv_append(): don't consume reference (diff) | |
download | qemu-3ca1f3225727419ba573673b744edac10904276f.tar.gz qemu-3ca1f3225727419ba573673b744edac10904276f.tar.xz qemu-3ca1f3225727419ba573673b744edac10904276f.zip |
block: BdrvChildClass: add .get_parent_aio_context handler
Add new handler to get aio context and implement it in all child
classes. Add corresponding public interface to be used soon.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210428151804.439460-6-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/block-backend.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index 413af51f3b..3f656ef361 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -298,6 +298,13 @@ static void blk_root_detach(BdrvChild *child) } } +static AioContext *blk_root_get_parent_aio_context(BdrvChild *c) +{ + BlockBackend *blk = c->opaque; + + return blk_get_aio_context(blk); +} + static const BdrvChildClass child_root = { .inherit_options = blk_root_inherit_options, @@ -318,6 +325,8 @@ static const BdrvChildClass child_root = { .can_set_aio_ctx = blk_root_can_set_aio_ctx, .set_aio_ctx = blk_root_set_aio_ctx, + + .get_parent_aio_context = blk_root_get_parent_aio_context, }; /* |