aboutsummaryrefslogtreecommitdiff
path: root/include/block/block_int.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-05-06 19:17:56 +0200
committerKevin Wolf <kwolf@redhat.com>2019-05-20 17:08:56 +0200
commit5d2318499fe980542fbc21d9ccbc127a6106017b (patch)
treeb69b4502f4d658bee21e7642c451eda22e15297a /include/block/block_int.h
parent25349e8250e67e7d126fbf0ad213811b62e7e529 (diff)
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_int.h')
-rw-r--r--include/block/block_int.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 94d45c9708..b150c5f047 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -691,6 +691,9 @@ struct BdrvChildRole {
* can update its reference. */
int (*update_filename)(BdrvChild *child, BlockDriverState *new_base,
const char *filename, Error **errp);
+
+ bool (*can_set_aio_ctx)(BdrvChild *child, AioContext *ctx,
+ GSList **ignore, Error **errp);
};
extern const BdrvChildRole child_file;