]> git.proxmox.com Git - qemu.git/commitdiff
block: add bdrv_get_aio_context()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 7 Mar 2013 12:41:48 +0000 (13:41 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 15 Mar 2013 15:07:51 +0000 (16:07 +0100)
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>
block.c
include/block/block_int.h

diff --git a/block.c b/block.c
index 0ab164d992c96ba688a7605a5ffe6425fe44c9bd..037e15e0655743ad383cc5e468b91861a18ec3cf 100644 (file)
--- 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();
+}
index baf80e3c42a682787ade1ee6c9af96b635aec09f..ce0aa26b8ef929fed560cd669a392675ec3863da 100644 (file)
@@ -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