qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 1/6] sheepdog: check if '-o redundancy' is passed fro


From: Kevin Wolf
Subject: [Qemu-devel] [PULL 1/6] sheepdog: check if '-o redundancy' is passed from user
Date: Fri, 13 Dec 2013 18:48:58 +0100

From: Liu Yuan <address@hidden>

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

$ qemu-img convert some_img sheepdog:some_img

Cc: address@hidden
Cc: Kevin Wolf <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Liu Yuan <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]