mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
vhost-user-scsi: support reconnect to backend
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 <fengli@smartx.com> Message-Id: <20231009044735.941655-4-fengli@smartx.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
This commit is contained in:
parent
4dfcc09f48
commit
7962e432b4
5 changed files with 201 additions and 30 deletions
|
@ -75,6 +75,7 @@ static int vhost_scsi_start(VHostSCSI *s)
|
|||
int ret, abi_version;
|
||||
VHostSCSICommon *vsc = VHOST_SCSI_COMMON(s);
|
||||
const VhostOps *vhost_ops = vsc->dev.vhost_ops;
|
||||
Error *local_err = NULL;
|
||||
|
||||
ret = vhost_ops->vhost_scsi_get_abi_version(&vsc->dev, &abi_version);
|
||||
if (ret < 0) {
|
||||
|
@ -88,14 +89,15 @@ static int vhost_scsi_start(VHostSCSI *s)
|
|||
return -ENOSYS;
|
||||
}
|
||||
|
||||
ret = vhost_scsi_common_start(vsc);
|
||||
ret = vhost_scsi_common_start(vsc, &local_err);
|
||||
if (ret < 0) {
|
||||
error_reportf_err(local_err, "Error starting vhost-scsi");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = vhost_scsi_set_endpoint(s);
|
||||
if (ret < 0) {
|
||||
error_report("Error setting vhost-scsi endpoint");
|
||||
error_reportf_err(local_err, "Error setting vhost-scsi endpoint");
|
||||
vhost_scsi_common_stop(vsc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue