From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHuaX-0001fF-CR for qemu-devel@nongnu.org; Tue, 19 Mar 2013 07:20:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHuaV-0004Qi-9d for qemu-devel@nongnu.org; Tue, 19 Mar 2013 07:20:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHuaV-0004Qe-1p for qemu-devel@nongnu.org; Tue, 19 Mar 2013 07:20:15 -0400 From: Kevin Wolf Date: Tue, 19 Mar 2013 12:19:50 +0100 Message-Id: <1363691994-20571-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1363691994-20571-1-git-send-email-kwolf@redhat.com> References: <1363691994-20571-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 1/5] sheepdog: show error message for halt status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Liu Yuan 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 Cc: Kevin Wolf Cc: Stefan Hajnoczi Signed-off-by: Liu Yuan Reviewed-by: Stefan Hajnoczi Reviewed-by: MORITA Kazutaka Signed-off-by: Kevin Wolf --- block/sheepdog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index 4245328..54d3e53 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) { -- 1.8.1.4