qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/3] virtio: call ->vhost_reset_device() during reset


From: Hanna Czenczek
Subject: Re: [PATCH v2 3/3] virtio: call ->vhost_reset_device() during reset
Date: Wed, 4 Oct 2023 13:04:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

On 04.10.23 03:45, Stefan Hajnoczi wrote:
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>
---
  meson.build               |  1 +
  include/hw/virtio/vhost.h | 10 ++++++++++
  hw/scsi/vhost-user-scsi.c | 11 -----------
  hw/virtio/vhost.c         |  9 +++++++++
  hw/virtio/virtio.c        |  4 ++++
  5 files changed, 24 insertions(+), 11 deletions(-)

Reviewed-by: Hanna Czenczek <hreitz@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]