From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFLC5-0001FV-No for qemu-devel@nongnu.org; Mon, 17 Feb 2014 05:13:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFLC0-0004NL-Lr for qemu-devel@nongnu.org; Mon, 17 Feb 2014 05:12:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFLC0-0004N8-Do for qemu-devel@nongnu.org; Mon, 17 Feb 2014 05:12:52 -0500 Date: Mon, 17 Feb 2014 11:12:44 +0100 From: Stefan Hajnoczi Message-ID: <20140217101244.GA28909@stefanha-thinkpad.redhat.com> References: <1392483801-15830-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1392483801-15830-1-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] block: Unlink temporary file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, =?iso-8859-1?Q?Beno=EEt?= Canet On Sat, Feb 15, 2014 at 06:03:21PM +0100, Max Reitz wrote: > If the image file cannot be opened and was created as a temporary file, > it should be deleted; thus, in this case, we should jump to the > "unlink_and_fail" label and not just to "fail". >=20 > Reported-by: Beno=EEt Canet > Signed-off-by: Max Reitz > --- > This patch's context depends on my bdrv_open()/bdrv_file_open() series > ("[PATCH v3 0/8] block: Integrate bdrv_file_open() into bdrv_open()"). > --- > block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/block.c b/block.c > index 62161bd..51c77b0 100644 > --- a/block.c > +++ b/block.c > @@ -1308,7 +1308,7 @@ int bdrv_open(BlockDriverState **pbs, const char = *filename, > bdrv_open_flags(bs, flags | BDRV_O_UNMAP) | > BDRV_O_PROTOCOL, true, &local_err); > if (ret < 0) { > - goto fail; > + goto unlink_and_fail; > } > =20 > /* Find the right image format driver */ Acked-by: Stefan Hajnoczi