From a3120deee5fc1d702ba5da98fd9c845ad1c8f301 Mon Sep 17 00:00:00 2001 From: Liu Yuan Date: Mon, 9 Dec 2013 00:11:20 +0800 Subject: sheepdog: check if '-o redundancy' is passed from user 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(-) (limited to 'block') 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++; -- cgit v1.1