diff options
author | Wen Congyang | 2015-09-08 05:28:32 +0200 |
---|---|---|
committer | Jeff Cody | 2015-09-25 14:37:07 +0200 |
commit | 9568b511c9f91c3d21ea3e83426d4ee7168c98bb (patch) | |
tree | db4332c4539db54b69b314a47a7eb4c921ca7104 /include/block/block.h | |
parent | sheepdog: add reopen support (diff) | |
download | qemu-9568b511c9f91c3d21ea3e83426d4ee7168c98bb.tar.gz qemu-9568b511c9f91c3d21ea3e83426d4ee7168c98bb.tar.xz qemu-9568b511c9f91c3d21ea3e83426d4ee7168c98bb.zip |
block: Introduce a new API bdrv_co_no_copy_on_readv()
In some cases, we need to disable copy-on-read, and just
read the data.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Message-id: 1441682913-14320-2-git-send-email-wency@cn.fujitsu.com
Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'include/block/block.h')
-rw-r--r-- | include/block/block.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/block/block.h b/include/block/block.h index ef67353108..2dd66300ed 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -51,15 +51,16 @@ typedef struct BlockFragInfo { } BlockFragInfo; typedef enum { - BDRV_REQ_COPY_ON_READ = 0x1, - BDRV_REQ_ZERO_WRITE = 0x2, + BDRV_REQ_COPY_ON_READ = 0x1, + BDRV_REQ_ZERO_WRITE = 0x2, /* The BDRV_REQ_MAY_UNMAP flag is used to indicate that the block driver * is allowed to optimize a write zeroes request by unmapping (discarding) * blocks if it is guaranteed that the result will read back as * zeroes. The flag is only passed to the driver if the block device is * opened with BDRV_O_UNMAP. */ - BDRV_REQ_MAY_UNMAP = 0x4, + BDRV_REQ_MAY_UNMAP = 0x4, + BDRV_REQ_NO_COPY_ON_READ = 0x8, } BdrvRequestFlags; typedef struct BlockSizes { @@ -252,6 +253,8 @@ int coroutine_fn bdrv_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov); int coroutine_fn bdrv_co_copy_on_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov); +int coroutine_fn bdrv_co_no_copy_on_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); /* |