提交 a3120dee 编写于 作者: L Liu Yuan 提交者: Kevin Wolf

sheepdog: check if '-o redundancy' is passed from user

This fix a segfault (that is caused by b3af018f) of following command:

$ qemu-img convert some_img sheepdog:some_img

Cc: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NLiu Yuan <namei.unix@gmail.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 47acdd63
......@@ -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++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册