qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user
@ 2013-12-08 16:11 Liu Yuan
  2013-12-09 13:10 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Yuan @ 2013-12-08 16:11 UTC (permalink / raw)
  To: sheepdog; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi

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 <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Liu Yuan <namei.unix@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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user
  2013-12-08 16:11 [Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user Liu Yuan
@ 2013-12-09 13:10 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2013-12-09 13:10 UTC (permalink / raw)
  To: Liu Yuan; +Cc: sheepdog, qemu-devel, Stefan Hajnoczi

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 <kwolf@redhat.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Liu Yuan <namei.unix@gmail.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-09 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-08 16:11 [Qemu-devel] [PATCH] sheepdog: check if '-o redundancy' is passed from user Liu Yuan
2013-12-09 13:10 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).