Re: [PATCH 1/4] vhost-user-blk: delay vhost_user_blk_disconnect

2020-04-20 Thread Li Feng
Hi Norwitz , Thanks for your good suggestion. I got this fix from net/vhost-user.c, it has the same issue with this case. Your suggestion is a good option. I'm trying to do some work. but there is another crash issue ... I need some time to make your idea be workable. This is the net/vhost-user p

Re: [PATCH 1/4] vhost-user-blk: delay vhost_user_blk_disconnect

2020-04-16 Thread Raphael Norwitz
On Wed, Apr 15, 2020 at 11:28:23AM +0800, Li Feng wrote: > > switch (event) { > case CHR_EVENT_OPENED: > @@ -363,7 +376,16 @@ static void vhost_user_blk_event(void *opaque, > QEMUChrEvent event) > } > break; > case CHR_EVENT_CLOSED: > -vhost_user_blk_disco

[PATCH 1/4] vhost-user-blk: delay vhost_user_blk_disconnect

2020-04-14 Thread Li Feng
Since commit b0a335e351103bf92f3f9d0bd5759311be8156ac, a socket write may trigger a disconnect events, calling vhost_user_blk_disconnect() and clearing all the vhost_dev strutures. Then the next socket read will encounter an invalid pointer to vhost_dev. Signed-off-by: Li Feng --- hw/block/vhost