summaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-07-14 17:27:13 +0200
committerKevin Wolf <kwolf@redhat.com>2011-08-02 15:53:40 +0200
commit344bd09bd5d15af4aae5bae3d6693614ba8e08ee (patch)
treec77f342d36c65fb1773c1f9c563f2d5b531e6f4e /block.h
parent38333e6a15130b9b17ef5affec6487bc95c58969 (diff)
downloadqemu-344bd09bd5d15af4aae5bae3d6693614ba8e08ee.tar.gz
qemu-344bd09bd5d15af4aae5bae3d6693614ba8e08ee.tar.bz2
qemu-344bd09bd5d15af4aae5bae3d6693614ba8e08ee.zip
block: Add bdrv_co_readv/writev
Add new block driver callbacks bdrv_co_readv/writev, which work on a QEMUIOVector like bdrv_aio_*, but don't need a callback. The function may only be called inside a coroutine, so a block driver implementing this interface can yield instead of blocking during I/O. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.h')
-rw-r--r--block.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/block.h b/block.h
index e672bc669a..a3bfaafef0 100644
--- a/block.h
+++ b/block.h
@@ -4,6 +4,7 @@
#include "qemu-aio.h"
#include "qemu-common.h"
#include "qemu-option.h"
+#include "qemu-coroutine.h"
#include "qobject.h"
/* block.c */
@@ -85,6 +86,10 @@ int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
const void *buf, int count);
int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset,
const void *buf, int count);
+int coroutine_fn bdrv_co_readv(BlockDriverState *bs, int64_t sector_num,
+ int nb_sectors, QEMUIOVector *qiov);
+int coroutine_fn bdrv_co_writev(BlockDriverState *bs, int64_t sector_num,
+ int nb_sectors, QEMUIOVector *qiov);
int bdrv_truncate(BlockDriverState *bs, int64_t offset);
int64_t bdrv_getlength(BlockDriverState *bs);
int64_t bdrv_get_allocated_file_size(BlockDriverState *bs);