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 <be...@igalia.com> > > 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