From c37a62b751647927ec8d09fd885cf4f36f81255c Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Thu, 13 Apr 2017 22:33:59 +0200 Subject: [PATCH] qemu-img/convert: Always set ret < 0 on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise the qemu-img process will exit with EXIT_SUCCESS instead of EXIT_FAILURE. Cc: qemu-stable Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé * applied directly to stable, upstream code has issue fixed via a refactoring introduced by 9fd77f9, which isn't targetted for stable Signed-off-by: Michael Roth --- qemu-img.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index b220cf71d7d..9aa7823b5e1 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2069,6 +2069,7 @@ static int img_convert(int argc, char **argv) opts = qemu_opts_parse_noisily(&qemu_object_opts, optarg, true); if (!opts) { + ret = -1; goto fail_getopt; } break; @@ -2081,6 +2082,7 @@ static int img_convert(int argc, char **argv) if (qemu_opts_foreach(&qemu_object_opts, user_creatable_add_opts_foreach, NULL, NULL)) { + ret = -1; goto fail_getopt; } -- 2.47.2