Re: [Qemu-devel] [PATCH] nbd: wait all read/write requests finished when shutdowning nbd socket

2015-09-16 Thread Paolo Bonzini
On 16/09/2015 10:22, Wen Congyang wrote: >>> >> if (exp->blk) { >>> >> +bdrv_drain(blk_bs(exp->blk)); >>> >> blk_remove_aio_context_notifier(exp->blk, blk_aio_attached, >>> >> blk_aio_detach, exp); >>> >>

Re: [Qemu-devel] [PATCH] nbd: wait all read/write requests finished when shutdowning nbd socket

2015-09-16 Thread Paolo Bonzini
On 16/09/2015 09:16, Wen Congyang wrote: > If the socket fd is shutdown, there may be some data which is received before > shutdown. We will read the data and do read/write in nbd_trip(). But the exp's > blk is NULL, and it will cause qemu crashed. > > Reported-by: Li Zhijian

Re: [Qemu-devel] [PATCH] nbd: wait all read/write requests finished when shutdowning nbd socket

2015-09-16 Thread Wen Congyang
On 09/16/2015 04:17 PM, Paolo Bonzini wrote: > > > On 16/09/2015 09:16, Wen Congyang wrote: >> If the socket fd is shutdown, there may be some data which is received before >> shutdown. We will read the data and do read/write in nbd_trip(). But the >> exp's >> blk is NULL, and it will cause

[Qemu-devel] [PATCH] nbd: wait all read/write requests finished when shutdowning nbd socket

2015-09-16 Thread Wen Congyang
If the socket fd is shutdown, there may be some data which is received before shutdown. We will read the data and do read/write in nbd_trip(). But the exp's blk is NULL, and it will cause qemu crashed. Reported-by: Li Zhijian Signed-off-by: Wen Congyang