Received: from eggs.gnu.org ([2001:4830:134:3::10]:45024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEFLN-0001CK-9F for qemu-devel@nongnu.org; Mon, 13 Nov 2017 09:04:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEFLH-0004aV-Gr for qemu-devel@nongnu.org; Mon, 13 Nov 2017 09:04:09 -0500 From: Alberto Garcia In-Reply-To: <20171108143354.GF30890@localhost.localdomain> References: <20171106145345.12038-1-berto@igalia.com> <20171108143354.GF30890@localhost.localdomain> Date: Mon, 13 Nov 2017 15:03:59 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] block: Close a BlockDriverState completely even when bs->drv is NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz On Wed 08 Nov 2017 03:33:54 PM CET, Kevin Wolf wrote: >> This patch makes bdrv_close() do the full uninitialization process in >> all cases. This fixes the problem with corrupted images and still >> works fine with freshly created BDSs. >> >> Signed-off-by: Alberto Garcia > > This doesn't apply cleanly in the test case. Does it depend on your > qcow2 fixes? Ah, yes. It doesn't have any semantic dependency though, so as long as you add the new tests to qemu-iotests/060 it will work. I can resend it properly rebased. > Also, while I think the change makes sense, it's also clear that we're > trying to fix up an inconsistent state here. Maybe we could also > improve the state that block drivers leave behind when marking an > image as corrupt. Just setting bs->drv = NULL means that at least any > internal data structures will not get cleaned up. > > On the other hand, we can't just call bdrv_close() from a failing > request because closing requires that we drain the request > first. Maybe it would be possible to call drv->bdrv_close() with a BH > or something. I'm not sure if I'm following you here, where would you add the bottom-half and what kind of problem it would solve? Berto