Re: [Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-24 Thread Greg Kurz
On Thu, 24 May 2018 09:05:53 +0100 Stefan Hajnoczi wrote: > On Thu, May 24, 2018 at 08:04:59AM +0200, Paolo Bonzini wrote: > > On 23/05/2018 16:46, Greg Kurz wrote: > > > Maybe change bdrv_root_unref_child() to ensure we don't call > > > bdrv_close() with pending I/O requests ? > > > > > > vo

Re: [Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-24 Thread Stefan Hajnoczi
On Thu, May 24, 2018 at 08:04:59AM +0200, Paolo Bonzini wrote: > On 23/05/2018 16:46, Greg Kurz wrote: > > Maybe change bdrv_root_unref_child() to ensure we don't call > > bdrv_close() with pending I/O requests ? > > > > void bdrv_root_unref_child(BdrvChild *child) > > { > > BlockDriverStat

Re: [Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-23 Thread Paolo Bonzini
On 23/05/2018 16:46, Greg Kurz wrote: > Maybe change bdrv_root_unref_child() to ensure we don't call > bdrv_close() with pending I/O requests ? > > void bdrv_root_unref_child(BdrvChild *child) > { > BlockDriverState *child_bs; > > child_bs = child->bs; > +bdrv_drained_begin(child

Re: [Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-23 Thread Greg Kurz
On Fri, 18 May 2018 16:32:46 +0100 Stefan Hajnoczi wrote: > On Wed, May 16, 2018 at 01:21:54PM +0200, Greg Kurz wrote: > > Removing a drive with drive_del while it is being used to run an I/O > > intensive workload can cause QEMU to crash. > > > > An AIO flush can yield at some point: > > > > b

Re: [Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-18 Thread Stefan Hajnoczi
On Wed, May 16, 2018 at 01:21:54PM +0200, Greg Kurz wrote: > Removing a drive with drive_del while it is being used to run an I/O > intensive workload can cause QEMU to crash. > > An AIO flush can yield at some point: > > blk_aio_flush_entry() > blk_co_flush(blk) > bdrv_co_flush(blk->root->bs)

Re: [Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-16 Thread Greg Kurz
Heh, of course I meant qemu-sta...@nongnu.org ;) On Wed, 16 May 2018 13:21:54 +0200 Greg Kurz wrote: > Removing a drive with drive_del while it is being used to run an I/O > intensive workload can cause QEMU to crash. > > An AIO flush can yield at some point: > > blk_aio_flush_entry() > blk_c

Re: [Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-16 Thread Greg KH
On Wed, May 16, 2018 at 01:21:54PM +0200, Greg Kurz wrote: > Removing a drive with drive_del while it is being used to run an I/O > intensive workload can cause QEMU to crash. > > An AIO flush can yield at some point: > > blk_aio_flush_entry() > blk_co_flush(blk) > bdrv_co_flush(blk->root->bs)

[Qemu-devel] [PATCH] block: fix QEMU crash with scsi-hd and drive_del

2018-05-16 Thread Greg Kurz
Removing a drive with drive_del while it is being used to run an I/O intensive workload can cause QEMU to crash. An AIO flush can yield at some point: blk_aio_flush_entry() blk_co_flush(blk) bdrv_co_flush(blk->root->bs) ... qemu_coroutine_yield() and let the HMP command to run, free bl