aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>2013-04-26 01:19:52 +0900
committerStefan Hajnoczi <stefanha@redhat.com>2013-04-26 13:26:28 +0200
commit6a0b5490338ed0fdf55c43062c88dd7638f05d6d (patch)
tree0f3ad3dc47c1d59acbdf09b0d636da17e5b90461
parent982dcbf4cbe80fa362c1edc37b2ced1cb8bcf37b (diff)
sheepdog: add SD_RES_READONLY result code
Sheepdog returns SD_RES_READONLY when qemu sends write requests to the snapshot vdi. This adds the result code and makes sd_strerror() print its error reason. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--block/sheepdog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 4326664200..f4e7204c7c 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -68,6 +68,7 @@
#define SD_RES_WAIT_FOR_JOIN 0x17 /* Waiting for other nodes joining */
#define SD_RES_JOIN_FAILED 0x18 /* Target node had failed to join sheepdog */
#define SD_RES_HALT 0x19 /* Sheepdog is stopped serving IO request */
+#define SD_RES_READONLY 0x1A /* Object is read-only */
/*
* Object ID rules
@@ -349,6 +350,7 @@ static const char * sd_strerror(int err)
{SD_RES_WAIT_FOR_JOIN, "Sheepdog is waiting for other nodes joining"},
{SD_RES_JOIN_FAILED, "Target node had failed to join sheepdog"},
{SD_RES_HALT, "Sheepdog is stopped serving IO request"},
+ {SD_RES_READONLY, "Object is read-only"},
};
for (i = 0; i < ARRAY_SIZE(errors); ++i) {