mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
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 fails 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.
All vhost-user devices have this issue, including vhost-user-blk/scsi.
With this patch, if the vdev->vdev is null, the fd callback will still
be reinstalled.
Fixes:
|
||
|---|---|---|
| .. | ||
| dataplane | ||
| block.c | ||
| cdrom.c | ||
| ecc.c | ||
| fdc-internal.h | ||
| fdc-isa.c | ||
| fdc-sysbus.c | ||
| fdc.c | ||
| hd-geometry.c | ||
| Kconfig | ||
| m25p80.c | ||
| m25p80_sfdp.c | ||
| m25p80_sfdp.h | ||
| meson.build | ||
| nand.c | ||
| onenand.c | ||
| pflash_cfi01.c | ||
| pflash_cfi02.c | ||
| swim.c | ||
| tc58128.c | ||
| trace-events | ||
| trace.h | ||
| vhost-user-blk.c | ||
| virtio-blk-common.c | ||
| virtio-blk.c | ||
| xen-block.c | ||
| xen_blkif.h | ||