diff options
author | Liu Yuan <tailai.ly@taobao.com> | 2013-03-18 14:27:55 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-03-19 11:48:36 +0100 |
commit | fca23f0ad211e4debf80796a65165d0eea146424 (patch) | |
tree | cdd394c9f78924c44a7d3bd76478cc9595608242 /block | |
parent | 2d62a95766025e6a0a333528278936e2cc8bf978 (diff) |
sheepdog: show error message for halt status
Sheepdog (neither quorum nor unsafe mode) will refuse to serve IO requests when
number of alive nodes is less than that of copies specified by users. This will
return 0x19 to QEMU client which currently doesn't recognize it.
This patch adds an error description when QEMU client receives it, other than
plainly printing 'Invalid error code'
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/sheepdog.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index 4245328569..54d3e53162 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -65,6 +65,7 @@ #define SD_RES_WAIT_FOR_FORMAT 0x16 /* Waiting for a format operation */ #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 */ /* * Object ID rules @@ -344,6 +345,7 @@ static const char * sd_strerror(int err) {SD_RES_WAIT_FOR_FORMAT, "Sheepdog is waiting for a format operation"}, {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"}, }; for (i = 0; i < ARRAY_SIZE(errors); ++i) { |