Received: from eggs.gnu.org ([2001:4830:134:3::10]:46191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btE73-0005vK-0Z for qemu-devel@nongnu.org; Sun, 09 Oct 2016 09:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btE71-0003bF-Vu for qemu-devel@nongnu.org; Sun, 09 Oct 2016 09:25:56 -0400 Date: Sun, 9 Oct 2016 15:25:55 +0200 From: Reda Sallahi Message-ID: <20161009132554.GA30176@vps308710.ovh.net> References: <1476004647-13482-1-git-send-email-xutian@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476004647-13482-1-git-send-email-xutian@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: failed qemu-img command should return non-zero exit code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xu Tian Cc: qemu-block@nongnu.org, kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org On Sun, Oct 09, 2016 at 05:17:27PM +0800, Xu Tian wrote: > If backing file can not open when do qemu-img rebase, var 'ret' not > assign a no-zero value, qemu-img process go out with exit code zero. > > Signed-off-by: Xu Tian > --- > qemu-img.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/qemu-img.c b/qemu-img.c > index 46f2a6d..37dcade 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -2918,6 +2918,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; > } > > @@ -2935,6 +2936,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; > } > } > -- > 2.5.5 > > Hi Xu, You should also CC qemu-devel@nongnu.org (and maybe Max Reitz too) in your patch. -- Reda