From 3b69e4b9ad3483bafcc3adc948703dc78e84ed33 Mon Sep 17 00:00:00 2001 From: aliguori Date: Thu, 22 Jan 2009 16:59:24 +0000 Subject: Vectored block device API (Avi Kivity) Most devices that are capable of DMA are also capable of scatter-gather. With the memory mapping API, this means that the device code needs to be able to access discontiguous host memory regions. For block devices, this translates to vectored I/O. This patch implements an aynchronous vectored interface for the qemu block devices. At the moment all I/O is bounced and submitted through the non-vectored API; in the future we will convert block devices to natively support vectored I/O wherever possible. Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6397 c046a42c-6fe2-441c-8c8c-71466251a162 --- block.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'block.h') diff --git a/block.h b/block.h index c3314a1..9733409 100644 --- a/block.h +++ b/block.h @@ -2,6 +2,7 @@ #define BLOCK_H #include "qemu-aio.h" +#include "qemu-common.h" /* block.c */ typedef struct BlockDriver BlockDriver; @@ -85,6 +86,13 @@ int bdrv_commit(BlockDriverState *bs); typedef struct BlockDriverAIOCB BlockDriverAIOCB; typedef void BlockDriverCompletionFunc(void *opaque, int ret); +BlockDriverAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num, + QEMUIOVector *iov, int nb_sectors, + BlockDriverCompletionFunc *cb, void *opaque); +BlockDriverAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num, + QEMUIOVector *iov, int nb_sectors, + BlockDriverCompletionFunc *cb, void *opaque); + BlockDriverAIOCB *bdrv_aio_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque); -- cgit v1.1