block: Add coroutine support to synchronous I/O functions
commit4f3c1c780fec95ec66e76554f4c2b03f0d4e07ab
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 20 Jan 2011 18:10:18 +0000 (20 18:10 +0000)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 21 Jan 2011 16:58:30 +0000 (21 16:58 +0000)
tree82b162e27e9a4cd986b6f0835b82b4f8d105a740
parent3b1359fff5212a975005d8e45cc5b142ca2e99c7
block: Add coroutine support to synchronous I/O functions

Implement transparent support for the following synchronous I/O
functions to be called from coroutines:

bdrv_read()
bdrv_write()
bdrv_pread()
bdrv_pwrite()
bdrv_pwrite_sync()
bdrv_write_sync()
bdrv_flush()

These functions will use asynchronous I/O behind the scenes but
otherwise behave the same as the truly synchronous implementations.

This change allows synchronous I/O code in QEMU to just work in a
coroutine.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
block.c
block.h