Re: [Qemu-devel] [PATCH 3/3] block: Drain requests in bdrv_close

2012-04-12 Thread Paolo Bonzini
Il 11/04/2012 12:40, Kevin Wolf ha scritto: > @@ -816,6 +816,8 @@ void bdrv_close(BlockDriverState *bs) > if (bs->job) { > block_job_cancel_sync(bs->job); > } > +bdrv_drain_all(); Actually the bdrv_drain_all needs to go first. This is because block_job_cance

[Qemu-devel] [PATCH 3/3] block: Drain requests in bdrv_close

2012-04-11 Thread Kevin Wolf
If an AIO request is in flight that refers to a BlockDriverState that has been closed and possibly even freed, more or less anything could happen. I have seen segfaults, -EBADF return values and qcow2 sometimes actually catches the situation in bdrv_close() and abort()s. Signed-off-by: Kevin Wolf