summary refs log tree commit diff stats
path: root/linux-headers/linux/psci.h
diff options
context:
space:
mode:
authorLi Feng <fengli@smartx.com>2024-05-16 10:57:46 +0800
committerMichael S. Tsirkin <mst@redhat.com>2024-07-01 17:16:04 -0400
commit6eaf0e612b415877d1c411b95bed2ecb53b546bb (patch)
treee8d6398512049d232ccb1f93fe2a020e97744e08 /linux-headers/linux/psci.h
parent9569fe0aacbe6c7752935c9ede427ca1e8aafe51 (diff)
downloadfocaccia-qemu-6eaf0e612b415877d1c411b95bed2ecb53b546bb.tar.gz
focaccia-qemu-6eaf0e612b415877d1c411b95bed2ecb53b546bb.zip
vhost-user: fix lost reconnect again
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 fail at get_features, the vhost_dev_cleanup will be called
immediately.

vhost_dev_cleanup calls 'memset(hdev, 0, sizeof(struct vhost_dev))'.

The reconnect path is:
vhost_user_blk_event
   vhost_user_async_close(.. vhost_user_blk_disconnect ..)
     qemu_chr_fe_set_handlers <----- clear the notifier callback
       schedule vhost_user_async_close_bh

The vhost->vdev is null, so the vhost_user_blk_disconnect will not be
called, then the event fd callback will not be reinstalled.

We need to ensure that even if vhost_dev_init initialization fails, the event
handler still needs to be reinstalled when s->connected is false.

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 <fengli@smartx.com>
Message-Id: <20240516025753.130171-3-fengli@smartx.com>
Reviewed-by: Raphael Norwitz <raphael@enfabrica.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'linux-headers/linux/psci.h')
0 files changed, 0 insertions, 0 deletions