Re: [Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user

2013-12-09 Thread Kevin Wolf
Am 08.12.2013 um 17:11 hat Liu Yuan geschrieben:
 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 kw...@redhat.com
 Cc: Stefan Hajnoczi stefa...@redhat.com
 Signed-off-by: Liu Yuan namei.u...@gmail.com

Thanks, applied to the block branch.

Kevin



[Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user

2013-12-08 Thread 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 kw...@redhat.com
Cc: Stefan Hajnoczi stefa...@redhat.com
Signed-off-by: Liu Yuan namei.u...@gmail.com
---
 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.7.9.5