From 897dd0ec4fdea4e6fa7674729750d05acc1bf41e Mon Sep 17 00:00:00 2001 From: Andrey Shinkevich Date: Wed, 16 Dec 2020 09:16:57 +0300 Subject: block: include supported_read_flags into BDS structure Add the new member supported_read_flags to the BlockDriverState structure. It will control the flags set for copy-on-read operations. Make the block generic layer evaluate supported read flags before they go to a block driver. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Andrey Shinkevich Signed-off-by: Vladimir Sementsov-Ogievskiy [vsementsov: use assert instead of abort] Reviewed-by: Max Reitz Message-Id: <20201216061703.70908-8-vsementsov@virtuozzo.com> Signed-off-by: Max Reitz --- include/block/block_int.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/block/block_int.h b/include/block/block_int.h index f3d0a0e60a..92d3754ead 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -881,6 +881,10 @@ struct BlockDriverState { /* I/O Limits */ BlockLimits bl; + /* + * Flags honored during pread + */ + unsigned int supported_read_flags; /* Flags honored during pwrite (so far: BDRV_REQ_FUA, * BDRV_REQ_WRITE_UNCHANGED). * If a driver does not support BDRV_REQ_WRITE_UNCHANGED, those -- cgit v1.2.3-55-g7522