Received: from eggs.gnu.org ([2001:4830:134:3::10]:46900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bap7i-00053l-Nu for qemu-devel@nongnu.org; Fri, 19 Aug 2016 15:06:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bap7e-0001IW-Ga for qemu-devel@nongnu.org; Fri, 19 Aug 2016 15:06:33 -0400 Date: Fri, 19 Aug 2016 21:06:08 +0200 From: Reda Sallahi Message-ID: <20160819190557.GA8418@vps308710.ovh.net> References: <20160815121149.21464-1-fullmanet@gmail.com> <20160816110906.GC8157@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160816110906.GC8157@stefanha-x1.localdomain> Subject: Re: [Qemu-devel] [PATCH v3] qemu-img: change opening method for the output in dd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi On Tue, Aug 16, 2016 at 12:09:06PM +0100, Stefan Hajnoczi wrote: > On Mon, Aug 15, 2016 at 02:11:49PM +0200, Reda Sallahi wrote: > > + blk2 = blk_new_open(image_opts ? NULL : out.filename, > > + NULL, qoptions, BDRV_O_RDWR, NULL); > > This code duplicates a subset of img_open(). Why can't you use > img_open() or at least img_open_opts()/img_open_file()? If I used img_open() here (or img_open_opts()/img_open_file() for that matter) it would have written on stderr that the file couldn't be opened here even though in this case it's not error if we can create the output image and open it later on. -- Reda