At the end of the VM live migration, the vhost device will be stopped.
Currently, if the vhost-user backend crash, vhost device's set_status()
would not return failure, live migration won't perceive the disconnection
with the backend. After the live migration is successful, the stale inflight
IO will be submitted to the migration target host, which may be leading to
the IO error.

The following patch series fixes the issue by making the live migration
aware of the loss of connection with the vhost-user backend and aborting
the live migration.

---
  v1 ... v2
    1. Fix some grammar 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 migration

 hw/block/vhost-user-blk.c             | 29 +++++++++++++++------------
 hw/block/virtio-blk.c                 |  2 +-
 hw/core/vm-change-state-handler.c     | 14 +++++++------
 hw/scsi/scsi-bus.c                    |  2 +-
 hw/scsi/vhost-scsi-common.c           | 13 ++++++------
 hw/scsi/vhost-user-scsi.c             | 20 ++++++++++--------
 hw/vfio/migration.c                   |  2 +-
 hw/virtio/vhost.c                     | 27 ++++++++++++++-----------
 hw/virtio/virtio.c                    | 25 ++++++++++++++++-------
 include/hw/virtio/vhost-scsi-common.h |  2 +-
 include/hw/virtio/vhost.h             |  8 +++++---
 include/hw/virtio/virtio.h            |  1 +
 include/system/runstate.h             | 11 +++++++---
 system/cpus.c                         |  4 ++--
 system/runstate.c                     | 25 ++++++++++++++++++-----
 15 files changed, 116 insertions(+), 69 deletions(-)

-- 
2.48.1


Reply via email to