From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnrnB-0005Zo-Gw for qemu-devel@nongnu.org; Tue, 03 Dec 2013 10:21:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnrn5-0002X1-Ec for qemu-devel@nongnu.org; Tue, 03 Dec 2013 10:21:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnrn5-0002Ww-6H for qemu-devel@nongnu.org; Tue, 03 Dec 2013 10:21:35 -0500 Date: Tue, 3 Dec 2013 16:21:28 +0100 From: Kevin Wolf Message-ID: <20131203152128.GH9956@dhcp-200-207.str.redhat.com> References: <1386079072-5035-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1386079072-5035-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3] block: Close backing file early in bdrv_img_create List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Wenchao Xia , qemu-devel@nongnu.org, Stefan Hajnoczi , Benoit Canet Am 03.12.2013 um 14:57 hat Max Reitz geschrieben: > Leaving the backing file open although it is not needed anymore can > cause problems if it is opened through a block driver which allows > exclusive access only and if the create function of the block driver > used for the top image (the one being created) tries to close and reopen > the image file (which will include opening the backing file a second > time). > > In particular, this will happen with a backing file opened through > qemu-nbd and using qcow2 as the top image file format (which reopens the > image to flush it to disk). > > In addition, the BlockDriverState in bdrv_img_create() is used for the > backing file only; it should therefore be made local to the respective > block. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf