From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnQoY-0003YB-Cb for qemu-devel@nongnu.org; Mon, 02 Dec 2013 05:33:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnQoS-0000TV-AO for qemu-devel@nongnu.org; Mon, 02 Dec 2013 05:33:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnQoS-0000TR-2Z for qemu-devel@nongnu.org; Mon, 02 Dec 2013 05:33:12 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB2AXBR7011364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 2 Dec 2013 05:33:11 -0500 Date: Mon, 2 Dec 2013 11:33:12 +0100 From: Kevin Wolf Message-ID: <20131202103312.GE2845@dhcp-200-207.str.redhat.com> References: <1385757689-23524-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385757689-23524-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] 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: qemu-devel@nongnu.org, Stefan Hajnoczi Am 29.11.2013 um 21:41 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). > > Signed-off-by: Max Reitz > --- > v2: > - Minimizing the changes prevents introducing a leak of the > BlockDriverState in case of an error in bdrv_open() (thanks, Kevin). Reviewed-by: Kevin Wolf