block: add bdrv_set_aio_context()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 8 May 2014 14:34:37 +0000 (16:34 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 4 Jun 2014 07:56:11 +0000 (09:56 +0200)
commitdcd042282d855edf70df90b7d61d33b515320b7a
tree51fc223c7a07e6b90230f7ab9b0ce12cbc32adbd
parent9b536adcbefb72090f43c9715ce042e37e47af73
block: add bdrv_set_aio_context()

Up until now all BlockDriverState instances have used the QEMU main loop
for fd handlers, timers, and BHs.  This is not scalable on SMP guests
and hosts so we need to move to a model with multiple event loops on
different host CPUs.

bdrv_set_aio_context() assigns the AioContext event loop to use for a
particular BlockDriverState.  It first detaches the entire
BlockDriverState graph from the current AioContext and then attaches to
the new AioContext.

This function will be used by virtio-blk data-plane to assign a
BlockDriverState to its IOThread AioContext.  Make
bdrv_aio_set_context() public since data-plane should not include
block_int.h.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c
include/block/block.h
include/block/block_int.h