The block drivers normally return -errno for typical errors. There is no appropriate error code for "wrong format", so use a special error code which does not conflict with system error codes.
Signed-off-by: Stefan Weil <s...@weilnetz.de> --- block.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block.h b/block.h index 893448a..829e18b 100644 --- a/block.h +++ b/block.h @@ -90,6 +90,13 @@ typedef struct BlockDevOps { #define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS) #define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1) +/* The block drivers normally return -errno for typical errors. + * There is no appropriate error code for "wrong format", so + * use a special error code which does not conflict with system + * error codes. + */ +#define BDRV_WRONG_FORMAT INT_MIN + typedef enum { BDRV_ACTION_REPORT, BDRV_ACTION_IGNORE, BDRV_ACTION_STOP } BlockErrorAction; -- 1.7.10.4