From 53fec9d3fd3d3a4ded4b92dfa843436bf71380f1 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Mon, 28 Nov 2011 16:08:47 +0000 Subject: block: add interface to toggle copy-on-read The bdrv_enable_copy_on_read()/bdrv_disable_copy_on_read() functions can be used to programmatically enable or disable copy-on-read for a block device. Later patches add the actual copy-on-read logic. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'block.h') diff --git a/block.h b/block.h index 8482dbc..5f8a98a 100644 --- a/block.h +++ b/block.h @@ -70,6 +70,7 @@ typedef struct BlockDevOps { #define BDRV_O_NATIVE_AIO 0x0080 /* use native AIO instead of the thread pool */ #define BDRV_O_NO_BACKING 0x0100 /* don't open the backing file */ #define BDRV_O_NO_FLUSH 0x0200 /* disable flushing on this disk */ +#define BDRV_O_COPY_ON_READ 0x0400 /* copy read backing sectors into image */ #define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH) @@ -312,6 +313,9 @@ void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, int nr_sectors); int64_t bdrv_get_dirty_count(BlockDriverState *bs); +void bdrv_enable_copy_on_read(BlockDriverState *bs); +void bdrv_disable_copy_on_read(BlockDriverState *bs); + void bdrv_set_in_use(BlockDriverState *bs, int in_use); int bdrv_in_use(BlockDriverState *bs); -- cgit v1.1