mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
virtio: call ->vhost_reset_device() during reset
vhost-user-scsi has a VirtioDeviceClass->reset() function that calls ->vhost_reset_device(). The other vhost devices don't notify the vhost device upon reset. Stateful vhost devices may need to handle device reset in order to free resources or prevent stale device state from interfering after reset. Call ->vhost_device_reset() from virtio_reset() so that that vhost devices are notified of device reset. This patch affects behavior as follows: - vhost-kernel: No change in behavior since ->vhost_reset_device() is not implemented. - vhost-user: back-ends that negotiate VHOST_USER_PROTOCOL_F_RESET_DEVICE now receive a VHOST_USER_DEVICE_RESET message upon device reset. Otherwise there is no change in behavior. DPDK, SPDK, libvhost-user, and the vhost-user-backend crate do not negotiate VHOST_USER_PROTOCOL_F_RESET_DEVICE automatically. - vhost-vdpa: an extra SET_STATUS 0 call is made during device reset. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20231004014532.1228637-4-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
This commit is contained in:
parent
e6383293eb
commit
c0c4f14729
5 changed files with 24 additions and 11 deletions
|
@ -2134,6 +2134,7 @@ config_host_data.set('CONFIG_TPM', have_tpm)
|
|||
config_host_data.set('CONFIG_TSAN', get_option('tsan'))
|
||||
config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
|
||||
config_host_data.set('CONFIG_VDE', vde.found())
|
||||
config_host_data.set('CONFIG_VHOST', have_vhost)
|
||||
config_host_data.set('CONFIG_VHOST_NET', have_vhost_net)
|
||||
config_host_data.set('CONFIG_VHOST_NET_USER', have_vhost_net_user)
|
||||
config_host_data.set('CONFIG_VHOST_NET_VDPA', have_vhost_net_vdpa)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue