[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] block: Add special error code for wrong format
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH 1/4] block: Add special error code for wrong format |
Date: |
Sat, 15 Dec 2012 15:09:30 +0100 |
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 <address@hidden>
---
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