qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset interface


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset interface
Date: Tue, 21 Nov 2023 19:38:49 +0100
User-agent: Mozilla Thunderbird

Hi Zhenzhong,

On 21/11/23 09:44, Zhenzhong Duan wrote:
Legacy vfio pci and iommufd cdev have different process to hot reset
vfio device, expand current code to abstract out pci_hot_reset callback
for legacy vfio, this same interface will also be used by iommufd
cdev vfio device.

Rename vfio_pci_hot_reset to vfio_legacy_pci_hot_reset and move it
into container.c.

vfio_pci_[pre/post]_reset and vfio_pci_host_match are exported so
they could be called in legacy and iommufd pci_hot_reset callback.

Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
---
  hw/vfio/pci.h                         |   3 +
  include/hw/vfio/vfio-container-base.h |   3 +
  hw/vfio/container.c                   | 170 ++++++++++++++++++++++++++
  hw/vfio/pci.c                         | 168 +------------------------
  4 files changed, 182 insertions(+), 162 deletions(-)


@@ -2485,166 +2485,10 @@ int vfio_pci_get_pci_hot_reset_info(VFIOPCIDevice 
*vdev,
static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool single)
  {

+    return ops->pci_hot_reset(vbasedev, single);

At this point vfio_iommufd_ops.pci_hot_reset is NULL.
Worth checking for non-NULL before calling.

  }
/*




reply via email to

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