diff options
author | Kevin Wolf <kwolf@redhat.com> | 2019-05-06 19:17:56 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-05-20 17:08:56 +0200 |
commit | 5d2318499fe980542fbc21d9ccbc127a6106017b (patch) | |
tree | b69b4502f4d658bee21e7642c451eda22e15297a /include/block/block.h | |
parent | 25349e8250e67e7d126fbf0ad213811b62e7e529 (diff) | |
download | qemu-5d2318499fe980542fbc21d9ccbc127a6106017b.zip qemu-5d2318499fe980542fbc21d9ccbc127a6106017b.tar.gz qemu-5d2318499fe980542fbc21d9ccbc127a6106017b.tar.bz2 |
block: Add bdrv_try_set_aio_context()
Eventually, we want to make sure that all parents and all children of a
node are in the same AioContext as the node itself. This means that
changing the AioContext may fail because one of the other involved
parties (e.g. a guest device that was configured with an iothread)
cannot allow switching to a different AioContext.
Introduce a set of functions that allow to first check whether all
involved nodes can switch to a new context and only then do the actual
switch. The check recursively covers children and parents.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block.h')
-rw-r--r-- | include/block/block.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h index 5e2b98b..fc0239a 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -586,6 +586,14 @@ void bdrv_coroutine_enter(BlockDriverState *bs, Coroutine *co); * This function must be called with iothread lock held. */ void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context); +int bdrv_try_set_aio_context(BlockDriverState *bs, AioContext *ctx, + Error **errp); +int bdrv_child_try_set_aio_context(BlockDriverState *bs, AioContext *ctx, + BdrvChild *ignore_child, Error **errp); +bool bdrv_child_can_set_aio_context(BdrvChild *c, AioContext *ctx, + GSList **ignore, Error **errp); +bool bdrv_can_set_aio_context(BlockDriverState *bs, AioContext *ctx, + GSList **ignore, Error **errp); int bdrv_probe_blocksizes(BlockDriverState *bs, BlockSizes *bsz); int bdrv_probe_geometry(BlockDriverState *bs, HDGeometry *geo); |