]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu-img/convert: Always set ret < 0 on error
authorMax Reitz <mreitz@redhat.com>
Thu, 13 Apr 2017 20:33:59 +0000 (22:33 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 31 Jul 2017 20:55:25 +0000 (15:55 -0500)
Otherwise the qemu-img process will exit with EXIT_SUCCESS instead of
EXIT_FAILURE.

Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
* 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 <mdroth@linux.vnet.ibm.com>
qemu-img.c

index b220cf71d7d54bdb8c53052a5cba40232cb1ca4d..9aa7823b5e13f6942fb72b287d14480a210e762b 100644 (file)
@@ -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;
     }