From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHTYK-0000Kh-Sk for qemu-devel@nongnu.org; Mon, 18 Mar 2013 02:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHTYJ-0005dy-E6 for qemu-devel@nongnu.org; Mon, 18 Mar 2013 02:28:12 -0400 Received: from mail-da0-x230.google.com ([2607:f8b0:400e:c00::230]:54696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHTYJ-0005de-7p for qemu-devel@nongnu.org; Mon, 18 Mar 2013 02:28:11 -0400 Received: by mail-da0-f48.google.com with SMTP id p8so300013dan.21 for ; Sun, 17 Mar 2013 23:28:09 -0700 (PDT) From: Liu Yuan Date: Mon, 18 Mar 2013 14:27:55 +0800 Message-Id: <1363588075-6660-1-git-send-email-namei.unix@gmail.com> Subject: [Qemu-devel] [PATCH] sheepdog: show error message for halt status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , MORITA Kazutaka 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 --- 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.7.9.5