Received: from eggs.gnu.org ([2001:4830:134:3::10]:32992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnrdM-0007Wb-9t for qemu-devel@nongnu.org; Fri, 23 May 2014 11:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnrdF-0006hU-If for qemu-devel@nongnu.org; Fri, 23 May 2014 11:43:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnrdF-0006h8-A7 for qemu-devel@nongnu.org; Fri, 23 May 2014 11:43:41 -0400 From: Stefan Hajnoczi Date: Fri, 23 May 2014 17:42:04 +0200 Message-Id: <1400859725-31879-33-git-send-email-stefanha@redhat.com> In-Reply-To: <1400859725-31879-1-git-send-email-stefanha@redhat.com> References: <1400859725-31879-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 32/33] block/sheepdog: Fix silent sd_open(), sd_create() failures List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Hajnoczi , Markus Armbruster , MORITA Kazutaka From: Markus Armbruster Open and create methods must set an error when they fail. Cc: MORITA Kazutaka Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Stefan Hajnoczi --- block/sheepdog.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index 6e2f981..7bf1275 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1412,6 +1412,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, ret = parse_vdiname(s, filename, vdi, &snapid, tag); } if (ret < 0) { + error_setg(errp, "Can't parse filename"); goto out; } s->fd = get_sheep_fd(s, errp); @@ -1453,6 +1454,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, closesocket(fd); if (ret) { + error_setg(errp, "Can't read snapshot inode"); goto out; } @@ -1654,6 +1656,7 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, ret = parse_vdiname(s, filename, s->name, &snapid, tag); } if (ret < 0) { + error_setg(errp, "Can't parse filename"); goto out; } @@ -1677,6 +1680,8 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, if (options->value.s) { ret = parse_redundancy(s, options->value.s); if (ret < 0) { + error_setg(errp, "Invalid redundancy mode: '%s'", + options->value.s); goto out; } } -- 1.9.0