[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from u
From: |
Liu Yuan |
Subject: |
[Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user |
Date: |
Mon, 9 Dec 2013 00:11:20 +0800 |
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>
---
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
- [Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user,
Liu Yuan <=