sheepdog: check if '-o redundancy' is passed from user
PATCH 1/1 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 Kevin Wolf <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
Signed-off-by Liu Yuan <[email protected]>
--- block/sheepdog.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
block/sheepdog.c +5 -3
@@ -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++;
Signature · 1 line
1.7.9.5
Kevin Wolf
AppliedAm 08.12.2013 um 17:11 hat Liu Yuan geschrieben:
Quoted 8 lines
This fix a segfault (that is caused by
b3af018f3) of following command:$ qemu-img convert some_img sheepdog:some_imgCc Kevin Wolf <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Liu Yuan <[email protected]>
Thanks, applied to the block branch.
Kevin