diff options
author | Eric Blake <eblake@redhat.com> | 2016-06-13 12:56:35 -0600 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-06-16 15:19:55 +0200 |
commit | fa166538743d4e28de7374c41332c3e448826f4b (patch) | |
tree | 38862e89a19f63d9331ff03df6447e7acddbd209 /include/block/block.h | |
parent | 73698c30caaf16e990b8b2e6e7bc64928947e65e (diff) | |
download | qemu-fa166538743d4e28de7374c41332c3e448826f4b.tar.gz qemu-fa166538743d4e28de7374c41332c3e448826f4b.tar.bz2 qemu-fa166538743d4e28de7374c41332c3e448826f4b.zip |
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 <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block.h')
-rw-r--r-- | include/block/block.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h index 54cca28bac..8cabcddf6c 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 { |