[PATCH v4 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-15 Thread Li Feng
ing in subsequent reconnection not being executed. The next patch will completely fix this issue with a better approach. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-use

[PATCH v4 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Li Feng
his issue, including vhost-user-blk/scsi. Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 3 ++- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-base.c | 3 ++- hw/virtio/vhost-user.c | 10

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Li Feng
> 2024年5月15日 23:47,Raphael Norwitz 写道: > > The case your describing makes sense but now I have some concerns on > the vhost_dev_cleanup bit. > > On Wed, May 15, 2024 at 1:47 AM Li Feng <mailto:fen...@smartx.com>> wrote: >> >> >> >>&g

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Li Feng
> 2024年5月14日 21:58,Raphael Norwitz 写道: > > Code looks good. Just a question on the error case you're trying to fix. > > On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: >> >> When the vhost-user is reconnecting to the backend, and if the vhost-user >

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Li Feng
> 2024年5月14日 21:58,Raphael Norwitz 写道: > > The code for these two patches looks fine. Just some questions on the > failure case you're trying to fix. > > > On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: >> >> This reverts commit f02a4b8e6431598612466

[PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Li Feng
ing in subsequent reconnection not being executed. The next patch will completely fix this issue with a better approach. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-use

[PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Li Feng
false. At this time, the event handler will be cleared. We need to ensure that the event handler can remain installed. All vhost-user devices have this issue, including vhost-user-blk/scsi. Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/

[PATCH v2 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-13 Thread Li Feng
This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-user.c | 10 ++ include/hw/virtio/vhost-user.h | 3

[PATCH v2 2/2] vhost-user: fix lost reconnect again

2024-05-13 Thread Li Feng
false. At this time, the event handler will be cleared. We need to ensure that the event handler can remain installed. All vhost-user devices have this issue, including vhost-user-blk/scsi. Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/

[PATCH 2/2] vhost-user: fix lost reconnect again

2024-04-26 Thread Li Feng
Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/virtio/vhost-user.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index c929097e87..c407ea8939 100644 --- a/hw/vir

[PATCH 1/2] Revert "vhost-user: fix lost reconnect"

2024-04-26 Thread Li Feng
This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-user.c | 10 ++ include/hw/virtio/vhost-user.h | 3

[PATCH 0/2] Fixed the problem of vhost-user reconnection

2024-04-26 Thread Li Feng
Previous discussion here: https://lore.kernel.org/all/f86d6159-5610-476c-a69e-cd3a717f9...@nvidia.com/ The merged version cannot fully cover all possible scenarios. Here we revert the previous fixes and then use new methods to fix them. Li Feng (2): Revert "vhost-user: fix lost reco

Re: vhost-user-blk reconnect issue

2024-04-02 Thread Li Feng
comments? Revert: https://lore.kernel.org/all/a68c0148e9bf105f9e83ff5e763b8fcb6f7ba9be.1697644299.git@redhat.com/ New: https://lore.kernel.org/all/20230804052954.2918915-2-fen...@smartx.com/ Thanks, Li > 2024年4月1日 16:43,Yajun Wu 写道: > > > > On 4/1/2024 4:34 PM, Li Feng wrote:

Re: vhost-user-blk reconnect issue

2024-04-01 Thread Li Feng
Hi yajun, I have submitted a patch to fix this problem a few months ago, but in the end this solution was not accepted and other solutions were adopted to fix it. https://lore.kernel.org/all/20230804052954.2918915-2-fen...@smartx.com/ This is the merged fix:

Re: [PATCH 1/1] vhost-scsi: fix usage of error_reportf_err()

2023-12-13 Thread Li Feng
> On Dec 14, 2023, at 08:31, Dongli Zhang wrote: > > It is required to use error_report() instead of error_reportf_err(), if the > prior function does not take local_err as the argument. As a result, the > local_err is always NULL and segment fault may happen. > > vhost_scsi_start() > ->

[PATCH 2/2] vhost-user-scsi: free the inflight area when reset

2023-11-22 Thread Li Feng
Keep it the same to vhost-user-blk. At the same time, fix the vhost_reset_device. Signed-off-by: Li Feng --- hw/scsi/vhost-user-scsi.c | 16 hw/virtio/virtio.c| 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi

[PATCH 0/2] fix some vhost-user issues

2023-11-22 Thread Li Feng
Li Feng (2): vhost-user: fix the reconnect error vhost-user-scsi: free the inflight area when reset hw/block/vhost-user-blk.c | 8 +++- hw/scsi/vhost-user-scsi.c | 19 ++- hw/virtio/vhost-user-gpio.c | 3 ++- hw/virtio/virtio.c | 2 +- 4 files changed

[PATCH 1/2] vhost-user: fix the reconnect error

2023-11-22 Thread Li Feng
If the error occurs in vhost_dev_init, the value of s->connected is set to true in advance, and there is no chance to enter this function execution again in the future. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 8 +++- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-u

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

2023-10-18 Thread Li Feng
Hello Guys, Ping… These patches have been waiting for a long time. Can they be merged? Best Regards, li > On 9 Oct 2023, at 12:46 PM, Li Feng wrote: > > Changes for v8: > - [PATCH 3/5] vhost-user-scsi: support reconnect to backend > - Fix code style suggested by Mano

[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 +- hw/scsi

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

2023-10-08 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 10 -- incl

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

2023-10-08 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi

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

2023-10-08 Thread Li Feng
reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common: send get_inflight_fd once vhost: move and rename the conn retry times vhost-user-scs

[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 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 a/hw

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

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

2023-10-08 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi

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

2023-10-08 Thread Li Feng
her mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common: send get_inflight_fd once vhost: move and rename the conn retry times vhost-user-scsi: support

[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 5/5] vhost-user: fix lost reconnect

2023-10-08 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 10 -- incl

[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 a/hw

[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 +- hw/scsi

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, 20

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

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

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

2023-10-08 Thread Li Feng
you? Otherwise do you think we should also > fix up the vhost-user-blk realize function? > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > If the backend crashes and restarts, the device is broken. > > This patch adds reconnect for vhost-user-scsi. > &

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

2023-09-22 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 +- hw/scsi

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

2023-09-22 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index a06f01af26

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

2023-09-22 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 10 -- include/hw/virtio/vhost-user.h | 3 +

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

2023-09-22 Thread Li Feng
patch to small separate patchset; - New patch for fixing fd leak, which has sent to reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common

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

2023-09-22 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 a/hw

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

2023-09-22 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 --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/hw/scsi

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

2023-09-19 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 a/hw

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

2023-09-19 Thread Li Feng
; - New patch for fixing fd leak, which has sent to reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common: send get_inflight_fd once vhost

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

2023-09-19 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 9 +++-- include/hw/virtio/vhost-user.h | 3 ++-

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

2023-09-19 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 --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/hw/scsi

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

2023-09-19 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index a06f01af26

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

2023-09-19 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 +- hw/scsi

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

2023-09-12 Thread Li Feng
the v1 patch to small separate patchset; - New patch for fixing fd leak, which has sent to reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user

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

2023-09-12 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 --- hw/scsi/vhost-user-scsi.c | 51 +++ 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/hw/scsi

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

2023-09-12 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 a/hw

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

2023-09-12 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 9 +++-- include/hw/virtio/vhost-user.h | 3 ++- 4 files changed, 11 insertions(+), 5 delet

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

2023-09-12 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index a06f01af26

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

2023-09-12 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 +- hw/scsi

Re: [PATCH v3 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-09-12 Thread Li Feng
> On 1 Sep 2023, at 8:00 PM, Markus Armbruster wrote: > > Li Feng mailto:fen...@smartx.com>> writes: > >> Add a Error parameter to report the real error, like vhost-user-blk. >> >> Signed-off-by: Li Feng >> --- >> hw/scsi/vhost-scsi-common.c

Re: [PATCH v3 4/5] vhost-user-scsi: support reconnect to backend

2023-09-12 Thread Li Feng
> On 1 Sep 2023, at 8:00 PM, Markus Armbruster wrote: > > Li Feng mailto:fen...@smartx.com>> writes: > >> If the backend crashes and restarts, the device is broken. >> This patch adds reconnect for vhost-user-scsi. >> >> Tested with spdk backend. &

Re: [PATCH v3 5/5] vhost-user-scsi: start vhost when guest kicks

2023-09-12 Thread Li Feng
> On 1 Sep 2023, at 7:44 PM, Markus Armbruster wrote: > > Li Feng mailto:fen...@smartx.com>> writes: > >> Let's keep the same behavior as vhost-user-blk. >> >> Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. >> >> Sign

[PATCH v3 1/2] vhost-user: Fix lost reconnect

2023-08-30 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 9 +++-- include/hw/virtio/vhost-user.h | 3 ++-

[PATCH v3 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-29 Thread Li Feng
Add a Error parameter to report the real error, like vhost-user-blk. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +--- hw/scsi/vhost-scsi.c | 5 +++-- hw/scsi/vhost-user-scsi.c | 14 -- include/hw/virtio/vhost-scsi

[PATCH v3 0/2] Fix vhost reconnect issues

2023-08-29 Thread Li Feng
/ Changes for v3: - Fix the code style. Changes for v2: - Add a event_cb in VhostAsyncCallback to be called when dev is NULL; - Fix the error report message. Li Feng (2): vhost-user: Fix lost reconnect vhost: Add Error parameter to vhost_scsi_common_start() hw/block/vhost-user-blk.c

Re: [PATCH v2 1/2] vhost-user: Fix lost reconnect

2023-08-29 Thread Li Feng
> On 30 Aug 2023, at 6:11 AM, Raphael Norwitz > wrote: > > > >> On Aug 24, 2023, at 3:41 AM, Li Feng wrote: >> >> When the vhost-user is reconnecting to the backend, and if the vhost-user >> fails >> at the get_features in v

[PATCH v2 1/2] vhost-user: Fix lost reconnect

2023-08-24 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 10 -- include/hw/virtio/vhost-user.h | 4 ++

[PATCH v2 0/2] Fix vhost reconnect issues

2023-08-24 Thread Li Feng
/ Changes for v2: - Add a event_cb in VhostAsyncCallback to be called when dev is NULL; - Fix the error report message. Li Feng (2): vhost-user: Fix lost reconnect vhost: Add Error parameter to vhost_scsi_common_start() hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-scsi

[PATCH v2 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-24 Thread Li Feng
Add a Error parameter to report the real error, like vhost-user-blk. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +--- hw/scsi/vhost-scsi.c | 5 +++-- hw/scsi/vhost-user-scsi.c | 14 -- include/hw/virtio/vhost-scsi

Re: [PATCH 1/2] vhost-user: fix lost reconnect

2023-08-24 Thread Li Feng
> On 22 Aug 2023, at 6:17 PM, Raphael Norwitz > wrote: > > > >> On Aug 22, 2023, at 12:49 AM, Li Feng wrote: >> >> >> >>> On 22 Aug 2023, at 8:38 AM, Raphael Norwitz >>> wrote: >>> >>>> >>>>

Re: [PATCH 1/2] vhost-user: fix lost reconnect

2023-08-21 Thread Li Feng
On 22 Aug 2023, at 8:38 AM, Raphael Norwitz wrote: On Aug 17, 2023, at 2:40 AM, Li Feng wrote: 2023年8月14日 下午8:11,Raphael Norwitz 写道: Why can’t we rather fix this by adding a “event_cb” param to vhost_user_async_close and then call qemu_chr_fe_set_handlers in vhost_user_async_close_bh

Re: [PATCH 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-21 Thread Li Feng
On 21 Aug 2023, at 8:09 PM, Markus Armbruster wrote: Li Feng writes: 2023年8月14日 下午8:11,Raphael Norwitz 写道: Thanks for the cleanup! A few comments. On Aug 4, 2023, at 1:29 AM, Li Feng wrote: Add a Error parameter to report the real error, like vhost-user-blk. Signed-off-by: Li Feng

Re: [PATCH 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-17 Thread Li Feng
> 2023年8月14日 下午8:11,Raphael Norwitz 写道: > > Thanks for the cleanup! A few comments. > >> On Aug 4, 2023, at 1:29 AM, Li Feng wrote: >> >> Add a Error parameter to report the real error, like vhost-user-blk. >> >> Signed-off-by: Li Feng >> -

Re: [PATCH 1/2] vhost-user: fix lost reconnect

2023-08-17 Thread Li Feng
{ /* @started: is the vhost device started? */ bool started; bool log_enabled; +bool inited; uint64_t log_size; Error *migration_blocker; const VhostOps *vhost_ops; Thanks. > >> On Aug 4, 2023, at 1:29 AM, Li Feng wrote: >> >> When the vhost

[PATCH 0/2] Fix vhost reconnect issues

2023-08-03 Thread Li Feng
/ Li Feng (2): vhost-user: fix lost reconnect vhost: Add Error parameter to vhost_scsi_common_start() hw/scsi/vhost-scsi-common.c | 17 ++--- hw/scsi/vhost-scsi.c | 5 +++-- hw/scsi/vhost-user-scsi.c | 14 -- hw/virtio/vhost

[PATCH 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-03 Thread Li Feng
Add a Error parameter to report the real error, like vhost-user-blk. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 17 ++--- hw/scsi/vhost-scsi.c | 5 +++-- hw/scsi/vhost-user-scsi.c | 14 -- include/hw/virtio/vhost-scsi

[PATCH 1/2] vhost-user: fix lost reconnect

2023-08-03 Thread Li Feng
Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/virtio/vhost-user.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 8dcf049d42..697b403fe2 100644 --- a/hw/vir

[PATCH v3 2/5] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index a06f01af26

[PATCH v3 3/5] vhost: move and rename the conn retry times

2023-07-31 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 a/hw

[PATCH v3 4/5] vhost-user-scsi: support reconnect to backend

2023-07-31 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-user-scsi.c | 199 +--- include/hw/virtio/vhost-user-scsi.h | 4 + 2 files changed

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

2023-07-31 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 --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/hw/scsi

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

2023-07-31 Thread Li Feng
. Li Feng (5): vhost: fix the fd leak vhost-user-common: send get_inflight_fd once vhost: move and rename the conn retry times vhost-user-scsi: support reconnect to backend vhost-user-scsi: start vhost when guest kicks hw/block/vhost-user-blk.c | 4 +- hw/scsi/vhost-scsi

[PATCH v3 1/5] vhost: fix the fd leak

2023-07-31 Thread Li Feng
When the vhost-user reconnect to the backend, the notifer should be cleanup. Otherwise, the fd resource will be exhausted. Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/virtio/vhost.c | 2 ++ 1 file

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Li Feng
> 2023年7月31日 06:13,Raphael Norwitz 写道: > >> >> On Jul 28, 2023, at 3:49 AM, Li Feng wrote: >> >> >> >>> 2023年7月28日 下午2:04,Michael S. Tsirkin 写道: >>> >>> On Tue, Jul 25, 2023 at 06:42:45PM +0800, Li Feng wrote: >>&

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-31 Thread Li Feng
> 2023年7月31日 06:09,Raphael Norwitz 写道: > > > >> On Jul 28, 2023, at 3:48 AM, Li Feng wrote: >> >> Thanks for your reply. >> >>> 2023年7月28日 上午5:21,Raphael Norwitz 写道: >>> >>> >>> >>>> On Jul 25, 2023,

Re: [PATCH v2 4/4] vhost-user-scsi: support reconnect to backend

2023-07-31 Thread Li Feng
think this is looking good. > > Glad to see you caught the vhost_user_scsi_handle_ouptut and implemented it > like vhost-user-blk. Can it go in a separate change? I will fix it in v3. > >> On Jul 25, 2023, at 6:42 AM, Li Feng wrote: >> >> If the backend crashe

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-28 Thread Li Feng
Thanks for your reply. > 2023年7月28日 上午5:21,Raphael Norwitz 写道: > > > >> On Jul 25, 2023, at 6:19 AM, Li Feng wrote: >> >> Thanks for your comments. >> >>> 2023年7月25日 上午1:21,Raphael Norwitz 写道: >>> >>> Very excited to see thi

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-28 Thread Li Feng
> 2023年7月28日 下午2:04,Michael S. Tsirkin 写道: > > On Tue, Jul 25, 2023 at 06:42:45PM +0800, Li Feng wrote: >> Get_inflight_fd is sent only once. When reconnecting to the backend, >> qemu sent set_inflight_fd to the backend. > > I don't understand what you are t

Re: [PATCH v2 4/4] vhost-user-scsi: support reconnect to backend

2023-07-25 Thread Li Feng
> 2023年7月25日 下午6:42,Li Feng 写道: > > If the backend crashes and restarts, the device is broken. > This patch adds reconnect for vhost-user-scsi. > > Tested with spdk backend. > > Signed-off-by: Li Feng > --- > hw/scsi/vhost-scsi-common.c | 6

[PATCH v2 4/4] vhost-user-scsi: support reconnect to backend

2023-07-25 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 6 + hw/scsi/vhost-user-scsi.c | 220 +++--- include/hw

[PATCH v2 0/4] Implement reconnect for vhost-user-scsi

2023-07-25 Thread Li Feng
the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (4): vhost: fix the fd leak vhost-user-common: send get_inflight_fd once vhost: move and rename the conn retry times vhost-user-scsi: support reconnect

[PATCH v2 1/4] vhost: fix the fd leak

2023-07-25 Thread Li Feng
When the vhost-user reconnect to the backend, the notifer should be cleanup. Otherwise, the fd resource will be exhausted. Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") Signed-off-by: Li Feng --- hw/virtio/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-25 Thread Li Feng
Get_inflight_fd is sent only once. When reconnecting to the backend, qemu sent set_inflight_fd to the backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi

[PATCH v2 3/4] vhost: move and rename the conn retry times

2023-07-25 Thread Li Feng
Multile devices need this macro, move it to a common header. Signed-off-by: Li Feng --- 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 a/hw/block/vhost-user-blk.c b/hw

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-25 Thread Li Feng
der, it’s not safe to > continue execution on reconnect, as there’s no way for the backend to know > how to replay IO. Should we permanently wedge the device or have QEMU fail > out? May be nice to have a toggle for this. Based on what MST said, is there anything else I need to do? > &

[PATCH] vhost: fix the fd leak

2023-07-24 Thread Li Feng
When the vhost-user reconnect to the backend, the notifer should be cleanup. Otherwise, the fd resource will be exhausted. Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") Signed-off-by: Li Feng --- hw/virtio/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH] vhost-user-scsi: support reconnect to backend

2023-07-21 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. Tested with spdk backend. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 - hw/scsi/vhost-scsi-common.c | 27 ++--- hw/scsi/vhost-user-scsi.c | 163

[PATCH] vhost-user-blk: fix the resize crash

2022-09-19 Thread Li Feng
If the os is not installed and doesn't have the virtio guest driver, the vhost dev isn't started, so the dev->vdev is NULL. Reproduce: mount a Win 2019 iso, go into the install ui, then resize the virtio-blk device, qemu crash. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 4

Re: [PATCH] vhost: reduce the set_mem_table call frenquency

2022-08-23 Thread Li Feng
Sorry, looks like I use the old qemu code, master has fix this issue. Just ignore this patch. > 2022年8月23日 下午1:38,Li Feng 写道: > > If the vhost memory layout doesn't change, don't need to call the vhost > backend. > The set_mem_table is time consuming when sending to vho

[PATCH] vhost: reduce the set_mem_table call frenquency

2022-08-22 Thread Li Feng
If the vhost memory layout doesn't change, don't need to call the vhost backend. The set_mem_table is time consuming when sending to vhost-user backend. On aarch64, the edk2 uefi firmware will write the pflash which will trigger the vhost_commit hundreds of times. Signed-off-by: Li Feng --- hw

[PATCH v5] file-posix: detect the lock using the real file

2020-12-15 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, add a new 'qemu_has_file_lock' to detect whether the file supports the file lock. And disable the lock when the underlay file system doesn't support locks. Signed-off-by: Li Feng --- v5: simpli

Re: [PATCH v4] file-posix: detect the lock using the real file

2020-12-15 Thread Li Feng
Daniel P. Berrangé 于2020年12月15日周二 下午6:08写道: > > On Tue, Dec 15, 2020 at 03:09:28PM +0800, Li Feng wrote: > > This patch addresses this issue: > > When accessing a volume on an NFS filesystem without supporting the file > > lock, > > tools, like qemu-img, will com

[PATCH v4] file-posix: detect the lock using the real file

2020-12-14 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, add a new 'qemu_has_file_lock' to detect whether the file supports the file lock. And disable the lock when the underlay file system doesn't support locks. Signed-off-by: Li Feng

[PATCH v3] file-posix: detect the lock using the real file

2020-12-10 Thread Li Feng
ve is auto mode, use the 'qemu_has_file_lock' to set the toggle. Signed-off-by: Li Feng --- v3: don't call the qemu_has_ofd_lock, use a new function instead. v2: remove the refactoring. --- block/file-posix.c | 30 +- include/qemu/osdep.h | 1 + util/osdep.c

[PATCH v2] file-posix: detect the lock using the real file

2020-12-10 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, make the 'qemu_has_ofd_lock' with a filename be more generic and reasonable. Signed-off-by: Li Feng --- v2: remove the refactoring. --- block/file-posix.c | 32 ++

  1   2   >