Re: [PATCH v5 3/3] vhost-user: return failure if backend crash when live migration

2025-04-22 Thread Haoqian He
> 2025年4月16日 10:47,Haoqian He 写道: > > Live migration should be terminated if the vhost-user backend crashes > before the migration completes. > > Specifically, since the vhost device will be stopped when VM is stopped > before the end of the live migration, in current

[PATCH v5 1/3] system/runstate: add VM state change cb with return value

2025-04-15 Thread Haoqian He
e will use VMChangeStateHandlerWithRet. Signed-off-by: Haoqian He --- hw/block/virtio-blk.c | 2 +- hw/core/vm-change-state-handler.c | 18 ++-- hw/scsi/scsi-bus.c| 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio.c| 2 +- incl

[PATCH v5 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-04-15 Thread Haoqian He
er: return failure if backend crashes when live migration', which makes the live migration aware of the loss of connection with the vhost-user backend and aborts the live migration. Signed-off-by: Haoqian He --- hw/virtio/vhost.c | 23 +-- include/hw/virtio/vhost.h |

[PATCH v5 3/3] vhost-user: return failure if backend crash when live migration

2025-04-15 Thread Haoqian He
set_status() can return failure to the upper layer, migration_completion() can handle the error, terminate the live migration, and restore the VM, so that inflight IO can be completed normally. Signed-off-by: Haoqian He --- backends/vhost-user.c | 20 +-- hw/block/

[PATCH v5 0/3] vhost: fix the IO error after live migration

2025-04-15 Thread Haoqian He
tus to int. v3 ... v4 1. Call set_status() only if the function pointer is not NULL in the 3rd patch. 2. Add the more detailed commit messages for the 3rd patch. v4 ... v5 1. Fix code style issues in patch v4. 2. Rebased on master. Haoqian He (3): system/runstate: ad

Re: [PATCH v4 3/3] vhost-user: return failure if backend crash when live migration

2025-04-07 Thread Haoqian He
> 2025年4月4日 05:15,Michael S. Tsirkin 写道: > > On Tue, Apr 01, 2025 at 11:18:17AM -0400, Haoqian He wrote: >> Live migration should be terminated if the vhost-user backend crashes >> before the migration completes. >> >> Specifically, since the vhost device w

Re: [PATCH v2 3/3] vhost-user: return failure if backend crash when live migration

2025-04-07 Thread Haoqian He
> 2025年4月4日 15:30,Stefano Garzarella 写道: > > On Thu, Mar 27, 2025 at 02:53:24PM +0800, Haoqian He wrote: >> >>> 2025年3月25日 17:51,Stefano Garzarella 写道: >>> >>> On Tue, Mar 25, 2025 at 04:39:46PM +0800, Haoqian He wrote: >>>>> 2025

[PATCH v4 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-04-05 Thread Haoqian He
er: return failure if backend crashes when live migration', which makes the live migration aware of the loss of connection with the vhost-user backend and aborts the live migration. Signed-off-by: Haoqian He --- hw/virtio/vhost.c | 23 +-- include/hw/virtio/vhost.h |

[PATCH v3 3/3] vhost-user: return failure if backend crash when live migration

2025-04-05 Thread Haoqian He
ation, and restore the VM, so that inflight IO can be completed normally. Signed-off-by: Haoqian He --- backends/vhost-user.c | 20 +-- hw/block/vhost-user-blk.c | 27 ++ hw/block/virtio-blk.c | 5 +++-- hw/char/vir

[PATCH v4 3/3] vhost-user: return failure if backend crash when live migration

2025-04-05 Thread Haoqian He
set_status() can return failure to the upper layer, migration_completion() can handle the error, terminate the live migration, and restore the VM, so that inflight IO can be completed normally. Signed-off-by: Haoqian He --- backends/vhost-user.c | 20 +-- hw/block/

[PATCH v4 1/3] system/runstate: add VM state change cb with return value

2025-04-01 Thread Haoqian He
e will use VMChangeStateHandlerWithRet. Signed-off-by: Haoqian He --- hw/block/virtio-blk.c | 2 +- hw/core/vm-change-state-handler.c | 18 ++-- hw/scsi/scsi-bus.c| 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio.c| 2 +- incl

[PATCH v4 0/3] vhost: fix the IO error after live migration

2025-04-01 Thread Haoqian He
tus to int. v3 ... v4 1. Call set_status() only if the function pointer is not NULL in the 3rd patch. 2. Add the more detailed commit messages for the 3rd patch. Haoqian He (3): system/runstate: add VM state change cb with return value vhost: return failure if stop virtqueue

Re: [PATCH v2 3/3] vhost-user: return failure if backend crash when live migration

2025-03-26 Thread Haoqian He
> 2025年3月25日 17:51,Stefano Garzarella 写道: > > On Tue, Mar 25, 2025 at 04:39:46PM +0800, Haoqian He wrote: >>> 2025年3月24日 22:31,Stefano Garzarella 写道: >>> On Thu, Mar 20, 2025 at 08:21:30PM +0800, Haoqian He wrote: >>>>> 2025年3月19日 23:20,Stefano Garzar

[PATCH v3 1/3] system/runstate: add VM state change cb with return value

2025-03-26 Thread Haoqian He
e will use VMChangeStateHandlerWithRet. Signed-off-by: Haoqian He --- hw/block/virtio-blk.c | 2 +- hw/core/vm-change-state-handler.c | 18 ++-- hw/scsi/scsi-bus.c| 2 +- hw/vfio/migration.c | 2 +- hw/virtio/virtio.c| 2 +- incl

[PATCH v3 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-03-26 Thread Haoqian He
er: return failure if backend crashes when live migration', which makes the live migration aware of the loss of connection with the vhost-user backend and aborts the live migration. Signed-off-by: Haoqian He --- hw/virtio/vhost.c | 23 +-- include/hw/virtio/vhost.h |

[PATCH v3 0/3] vhost: fix the IO error after live migration

2025-03-26 Thread Haoqian He
tus to int. Haoqian He (3): system/runstate: add VM state change cb with return value vhost: return failure if stop virtqueue failed in vhost_dev_stop vhost-user: return failure if backend crash when live migration backends/vhost-user.c | 20 +++ hw/block/vhost-

Re: [PATCH v2 3/3] vhost-user: return failure if backend crash when live migration

2025-03-25 Thread Haoqian He
> 2025年3月24日 22:31,Stefano Garzarella 写道: > > On Thu, Mar 20, 2025 at 08:21:30PM +0800, Haoqian He wrote: >> >> >>> 2025年3月19日 23:20,Stefano Garzarella 写道: >>> >>> On Fri, Mar 14, 2025 at 06:15:34AM -0400, Haoqian He wrote: >>>>

Re: [PATCH v2 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-03-25 Thread Haoqian He
2025年3月24日 22:25,Stefano Garzarella 写道: On Thu, Mar 20, 2025 at 08:21:25PM +0800, Haoqian He wrote: 2025年3月19日 23:11,Stefano Garzarella 写道: On Fri, Mar 14, 2025 at 06:15:33AM -0400, Haoqian He wrote: The backend maybe crash when vhost_dev_stop and GET_VRING_BASE would fail, we can return

Re: [PATCH v2 3/3] vhost-user: return failure if backend crash when live migration

2025-03-20 Thread Haoqian He
> 2025年3月19日 23:20,Stefano Garzarella 写道: > > On Fri, Mar 14, 2025 at 06:15:34AM -0400, Haoqian He wrote: >> Live migration should be terminated if the backend crashes before >> the migration completes. >> >> Since the vhost device will be stopped when VM is

Re: [PATCH v2 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-03-20 Thread Haoqian He
> 2025年3月19日 23:11,Stefano Garzarella 写道: > > On Fri, Mar 14, 2025 at 06:15:33AM -0400, Haoqian He wrote: >> The backend maybe crash when vhost_dev_stop and GET_VRING_BASE >> would fail, we can return failure to indicate the connection >> with the backend is b

Re: [PATCH v2 1/3] virtio: add VM state change cb with return value

2025-03-20 Thread Haoqian He
> 2025年3月19日 22:50,Stefano Garzarella 写道: > > On Fri, Mar 14, 2025 at 06:15:32AM -0400, Haoqian He wrote: >> This patch contains two changes: >> >> 1. Add VM state change cb type VMChangeStateHandlerExt which has return >> value for virtio devices VMChange

[PATCH v2 3/3] vhost-user: return failure if backend crash when live migration

2025-03-14 Thread Haoqian He
on. 2. In set_status_ext(), return failure if the flag `connected` is false or vhost_dev_stop return failure, which means qemu lost connection with backend. Hence migration_completion() will process failure, terminate migration and restore VM. Signed-off-by: Haoqian He --- hw/block/vhost-user-blk.c

[PATCH v2 1/3] virtio: add VM state change cb with return value

2025-03-14 Thread Haoqian He
This patch contains two changes: 1. Add VM state change cb type VMChangeStateHandlerExt which has return value for virtio devices VMChangeStateEntry. When VM state changes, virtio device will call the _Ext version. 2. Add return value for vm_state_notify(). Signed-off-by: Haoqian He --- hw

[PATCH v2 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-03-14 Thread Haoqian He
The backend maybe crash when vhost_dev_stop and GET_VRING_BASE would fail, we can return failure to indicate the connection with the backend is broken. Signed-off-by: Haoqian He --- hw/virtio/vhost.c | 27 +++ include/hw/virtio/vhost.h | 8 +--- 2 files

[PATCH v2 0/3] vhost: fix the IO error after live migration

2025-03-14 Thread Haoqian He
mar issues in commit message. 2. Remove assert in vhost_scsi_common_stop and return error upwards. Haoqian He (3): virtio: add VM state change cb with return value vhost: return failure if stop virtqueue failed in vhost_dev_stop vhost-user: return failure if backend crash when live migr

Re: [PATCH 3/3] vhost-user: return failure if backend crash when live migration

2025-03-11 Thread Haoqian He
gt;> is false or vhost_dev_stop return failure, which means qemu lost >> connection with backend. > > I have some concerns with [2]. See my later responses. > >> >> Hence migration_completion() will process failure, terminate >> migration and restore VM. >>

[PATCH 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-03-09 Thread Haoqian He
The backend maybe crash when vhost_dev_stop and GET_VRING_BASE would fail, we can return failure to indicate the connection with the backend is broken. Signed-off-by: Haoqian He --- hw/virtio/vhost.c | 27 +++ include/hw/virtio/vhost.h | 8 +--- 2 files

[PATCH 3/3] vhost-user: return failure if backend crash when live migration

2025-03-09 Thread Haoqian He
f the flag `connected` is false or vhost_dev_stop return failure, which means qemu lost connection with backend. Hence migration_completion() will process failure, terminate migration and restore VM. Signed-off-by: Haoqian He --- hw/block/vhost-user-blk.c | 29 +++---

[PATCH 1/3] virtio: add VM state change cb with return value

2025-03-09 Thread Haoqian He
This patch contains two changes: 1. Add VM state change cb type VMChangeStateHandlerExt which has return value for virtio devices VMChangeStateEntry. When VM state changes, virtio device will call the _Ext version. 2. Add return value for vm_state_notify(). Signed-off-by: Haoqian He --- hw

[PATCH 0/3] vhost: fix the IO error after live migration

2025-03-09 Thread Haoqian He
nflight IO would be submitted to the migration target host, which may leading to the IO error. The following patch series fixes the issue by making the live migration aware of the lost of connection with the vhost-user backend and aborting the live migration. Haoqian He (3): virtio: add VM state

Re: [PATCH] chardev: use remoteAddr if the chardev is client

2025-02-25 Thread Haoqian He
> 2025年2月25日 21:29,Marc-André Lureau 写道: > > Hi Haoqian > > On Tue, Feb 25, 2025 at 5:19 PM Haoqian He wrote: >> >> I use chardev to connect with a vhost-user target, the chardev backend type >> is >> socket, part of QEMU boot parameter: >> -d

[PATCH] chardev: use remoteAddr if the chardev is client

2025-02-25 Thread Haoqian He
when computing the client chardev socket file path, using remoteAddr is more appropriate. Signed-off-by: Haoqian He --- chardev/char-socket.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 91496ceda9..2f842f9f88 1