Received: from eggs.gnu.org ([2001:4830:134:3::10]:35365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvovx-0004I7-QI for qemu-devel@nongnu.org; Mon, 09 Nov 2015 11:04:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvovw-0006h5-Rb for qemu-devel@nongnu.org; Mon, 09 Nov 2015 11:04:41 -0500 Date: Mon, 9 Nov 2015 17:04:26 +0100 From: Kevin Wolf Message-ID: <20151109160426.GE3621@noname.redhat.com> References: <1446663467-22485-1-git-send-email-mreitz@redhat.com> <1446663467-22485-4-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446663467-22485-4-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 03/15] block: Release dirty bitmaps in bdrv_close() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Alberto Garcia , qemu-block@nongnu.org, qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi , Paolo Bonzini Am 04.11.2015 um 19:57 hat Max Reitz geschrieben: > bdrv_delete() is not very happy about deleting BlockDriverStates with > dirty bitmaps still attached to them. In the past, we got around that > very easily by relying on bdrv_close_all() bypassing bdrv_delete(), and > bdrv_close() simply ignoring that condition. We should fix that by > releasing all dirty bitmaps in bdrv_close() This doesn't sound right. If there was a dirty bitmap, there must be a user associated with it. Now that we simply free the bitmap, that user has a dangling pointer. An exception would be if we knew that the only "user" of this bitmap is the monitor because the monitor doesn't actually maintain its own list of bitmaps. However, it's doubtful whether bdrv_close() should remove something that the QMP client added explicitly. > and drop the assertion in bdrv_delete(). Why? It should still hold true. Kevin