[PATCH v8 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +-

[PATCH v8 5/5] vhost-user: fix lost reconnect

2023-10-08 Thread Li Feng
When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fails at get_features, the vhost_dev_cleanup will be called immediately.

[PATCH v8 2/5] vhost: move and rename the conn retry times

2023-10-08 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git

[PATCH v8 4/5] vhost-user-scsi: start vhost when guest kicks

2023-10-08 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4

[PATCH v8 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
Currently the get_inflight_fd will be sent every time the device is started, and the backend will allocate shared memory to save the inflight state. If the backend finds that it receives the second get_inflight_fd, it will release the previous shared memory, which breaks inflight working logic.

[PATCH v8 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
Changes for v8: - [PATCH 3/5] vhost-user-scsi: support reconnect to backend - Fix code style suggested by Manos Pitsidianakis - [PATCH 4/5] vhost-user-scsi: start vhost when guest kicks - Use 'DEVICE()' macro in vhost_user_scsi_handle_output to replace the

Re: [PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
Thanks for your comments, I will submit the v8. > On 8 Oct 2023, at 6:46 PM, Manos Pitsidianakis > wrote: > > Hello Li, I have some trivial style comments you could possibly address in a > next version: > > On Sun, 08 Oct 2023 12:12, Li Feng wrote: >> diff --git a/hw/scsi/vhost-user-scsi.c

Re: [PATCH 15/19] parallels: Remove unnecessary data_end field

2023-10-08 Thread Alexander Ivanov
On 10/7/23 19:54, Mike Maslenkin wrote: On Sat, Oct 7, 2023 at 5:30 PM Alexander Ivanov wrote: On 10/7/23 13:21, Mike Maslenkin wrote: On Sat, Oct 7, 2023 at 1:18 PM Alexander Ivanov wrote: On 10/6/23 21:43, Mike Maslenkin wrote: On Mon, Oct 2, 2023 at 12:01 PM Alexander Ivanov

Re: [PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Manos Pitsidianakis
Hello Li, I have some trivial style comments you could possibly address in a next version: On Sun, 08 Oct 2023 12:12, Li Feng wrote: diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index df6b66cc1a..5df24faff4 100644 --- a/hw/scsi/vhost-user-scsi.c +++

[PATCH v7 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
Currently the get_inflight_fd will be sent every time the device is started, and the backend will allocate shared memory to save the inflight state. If the backend finds that it receives the second get_inflight_fd, it will release the previous shared memory, which breaks inflight working logic.

[PATCH v7 5/5] vhost-user: fix lost reconnect

2023-10-08 Thread Li Feng
When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fails at get_features, the vhost_dev_cleanup will be called immediately.

[PATCH v7 4/5] vhost-user-scsi: start vhost when guest kicks

2023-10-08 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4

[PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +-

[PATCH v7 2/5] vhost: move and rename the conn retry times

2023-10-08 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git

[PATCH v7 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
Changes for v7: - [PATCH 3/5] vhost-user-scsi: support reconnect to backend - Add reporting the error in vhost-scsi; - Rebase to master and fix the conflict. - Add "Reviewed-by" tags. Changes for v6: - [PATCH] vhost-user: fix lost reconnect - Fix missing assign event_cb. Changes for v5: -

Re: [PATCH v6 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
On Sun, Oct 8, 2023 at 4:49 PM Michael S. Tsirkin wrote: > > On Fri, Sep 22, 2023 at 07:46:10PM +0800, Li Feng wrote: > > Changes for v6: > > - [PATCH] vhost-user: fix lost reconnect > > - Fix missing assign event_cb. > > > Pls don't make vN+1 a reply to vN - start a new thread > with each

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
On Sun, Oct 8, 2023 at 4:51 PM Michael S. Tsirkin wrote: > > On Sun, Oct 08, 2023 at 04:49:05PM +0800, Li Feng wrote: > > On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz > > wrote: > > > > > > > > > > > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > > > > > Currently the

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz wrote: > > > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > Currently the get_inflight_fd will be sent every time the device is > > started, and > > the backend will allocate shared memory to save the inflight state. If the > > backend

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Michael S. Tsirkin
On Sun, Oct 08, 2023 at 04:49:05PM +0800, Li Feng wrote: > On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz > wrote: > > > > > > > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > > > Currently the get_inflight_fd will be sent every time the device is > > > started, and > > > the backend

Re: [PATCH v6 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Michael S. Tsirkin
On Fri, Sep 22, 2023 at 07:46:10PM +0800, Li Feng wrote: > Changes for v6: > - [PATCH] vhost-user: fix lost reconnect > - Fix missing assign event_cb. Pls don't make vN+1 a reply to vN - start a new thread with each version please. > Changes for v5: > - No logic has been changed, just move

Re: [PATCH v6 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
Sorry, the reply is late due to being on vacation for half a month. On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz wrote: > > One comment on the logging stuff in vhost-scsi. As far as I can tell the > logging in vhost-user-scsi looks good. > > Markus - does this look better to you? Otherwise