From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrWrc-0004gV-VV for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:49:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrWrW-0003pp-Ny for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:49:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrWrW-0003pe-GN for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:49:18 -0500 From: Kevin Wolf Date: Fri, 13 Dec 2013 18:48:58 +0100 Message-Id: <1386956943-19474-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1386956943-19474-1-git-send-email-kwolf@redhat.com> References: <1386956943-19474-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 1/6] sheepdog: check if '-o redundancy' is passed from user 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 This fix a segfault (that is caused by b3af018f3) of following command: $ qemu-img convert some_img sheepdog:some_img Cc: qemu-devel@nongnu.org Cc: Kevin Wolf Cc: Stefan Hajnoczi Signed-off-by: Liu Yuan Signed-off-by: Kevin Wolf --- block/sheepdog.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index b4ae50f..d1c812d 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1666,9 +1666,11 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, goto out; } } else if (!strcmp(options->name, BLOCK_OPT_REDUNDANCY)) { - ret = parse_redundancy(s, options->value.s); - if (ret < 0) { - goto out; + if (options->value.s) { + ret = parse_redundancy(s, options->value.s); + if (ret < 0) { + goto out; + } } } options++; -- 1.8.1.4