aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2013-03-07 13:41:48 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-15 16:07:51 +0100
commit85d126f3ee666702ac514c66606c62d276c4341c (patch)
treef133791f34717ba10ebf0b87ab57d2a3ec80a451
parent9b34277d23a6fb15eb9513006c96d8026beeea1f (diff)
block: add bdrv_get_aio_context()
For now bdrv_get_aio_context() is just a stub that calls qemu_aio_get_context() since the block layer is currently tied to the main loop AioContext. Add the stub now so that the block layer can begin accessing its AioContext. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--block.c6
-rw-r--r--include/block/block_int.h7
2 files changed, 13 insertions, 0 deletions
diff --git a/block.c b/block.c
index 0ab164d992..037e15e065 100644
--- a/block.c
+++ b/block.c
@@ -4681,3 +4681,9 @@ out:
bdrv_delete(bs);
}
}
+
+AioContext *bdrv_get_aio_context(BlockDriverState *bs)
+{
+ /* Currently BlockDriverState always uses the main loop AioContext */
+ return qemu_get_aio_context();
+}
diff --git a/include/block/block_int.h b/include/block/block_int.h
index baf80e3c42..ce0aa26b8e 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -294,6 +294,13 @@ int get_tmp_filename(char *filename, int size);
void bdrv_set_io_limits(BlockDriverState *bs,
BlockIOLimit *io_limits);
+/**
+ * bdrv_get_aio_context:
+ *
+ * Returns: the currently bound #AioContext
+ */
+AioContext *bdrv_get_aio_context(BlockDriverState *bs);
+
#ifdef _WIN32
int is_windows_drive(const char *filename);
#endif