From fa166538743d4e28de7374c41332c3e448826f4b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 13 Jun 2016 12:56:35 -0600 Subject: block: Assert that flags are in range Add a new BDRV_REQ_MASK constant, and use it to make sure that caller flags are always valid. Tested with 'make check' and with qemu-iotests on both '-raw' and '-qcow2'; the only failure turned up was fixed in the previous commit. Signed-off-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- include/block/block.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/block/block.h') diff --git a/include/block/block.h b/include/block/block.h index 54cca28..8cabcdd 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -65,6 +65,9 @@ typedef enum { BDRV_REQ_MAY_UNMAP = 0x4, BDRV_REQ_NO_SERIALISING = 0x8, BDRV_REQ_FUA = 0x10, + + /* Mask of valid flags */ + BDRV_REQ_MASK = 0x1f, } BdrvRequestFlags; typedef struct BlockSizes { -- cgit v1.1