From: Xu Tian Date: Sun, 9 Oct 2016 09:17:27 +0000 (+0800) Subject: block: failed qemu-img command should return non-zero exit code X-Git-Tag: qemu-xen-4.9.0-rc1~125^2~10 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e84a0dd5a75d8e89bec05fac432941988191df32;p=qemu-xen.git block: failed qemu-img command should return non-zero exit code If the backing file cannot be opened when doing qemu-img rebase, the variable 'ret' was not assigned a non-zero value, and the qemu-img process terminated with exit code zero. Fix this. Signed-off-by: Xu Tian Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- diff --git a/qemu-img.c b/qemu-img.c index 67e851248a..ab395a9b1a 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2956,6 +2956,7 @@ static int img_rebase(int argc, char **argv) error_reportf_err(local_err, "Could not open old backing file '%s': ", backing_name); + ret = -1; goto out; } @@ -2973,6 +2974,7 @@ static int img_rebase(int argc, char **argv) error_reportf_err(local_err, "Could not open new backing file '%s': ", out_baseimg); + ret = -1; goto out; } }