Re: [Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at system_reset

2016-08-04 Thread Paolo Bonzini
On 03/08/2016 02:52, Fam Zheng wrote: >> > It's also (perhaps especially) because blk_drain() can consume them. Fam's >> > patch to do blk_drain() first would cause a double-free. > That "consume" part is what I don't understand. > > Shouldn't blk_drain() only process submitted requests (and fu

Re: [Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at system_reset

2016-08-02 Thread Fam Zheng
On Tue, 08/02 13:00, Paolo Bonzini wrote: > > > I'd prefer if Paolo's remark (about blk_drain()'s ability to produce > > more failed requests, stashed in s->rq) were captured in either the > > commit message, or in a code comment. Something like: > > > > /* We drop queued requests after blk_dra

Re: [Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at system_reset

2016-08-02 Thread Paolo Bonzini
> I'd prefer if Paolo's remark (about blk_drain()'s ability to produce > more failed requests, stashed in s->rq) were captured in either the > commit message, or in a code comment. Something like: > > /* We drop queued requests after blk_drain() because blk_drain() >* itself can produce the

Re: [Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at system_reset

2016-08-02 Thread Laszlo Ersek
On 08/02/16 15:00, Fam Zheng wrote: > At system_reset, there is no point in retrying the queued request, > because the driver that issued the request won't be around any more. > > Analyzed-by: Laszlo Ersek > Reported-by: Laszlo Ersek > Signed-off-by: Fam Zheng > --- > hw/block/virtio-blk.c | 6

[Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at system_reset

2016-08-02 Thread Fam Zheng
At system_reset, there is no point in retrying the queued request, because the driver that issued the request won't be around any more. Analyzed-by: Laszlo Ersek Reported-by: Laszlo Ersek Signed-off-by: Fam Zheng --- hw/block/virtio-blk.c | 6 ++ 1 file changed, 6 insertions(+) diff --git