On 8/1/25 04:35, Zhenzhong Duan wrote:
Introduce helper vfio_pci_from_vfio_device() to transform from VFIODevice
to VFIOPCIDevice, also to hide low level VFIO_DEVICE_TYPE_PCI type check.

Suggested-by: Cédric Le Goater <c...@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.d...@intel.com>
---
v3: add one line comment to the helper
v2: move helper to hw/vfio/pci.[hc]
     rename with vfio_pci_ prefix

  hw/vfio/pci.h       | 1 +
  hw/vfio/container.c | 4 ++--
  hw/vfio/device.c    | 2 +-
  hw/vfio/iommufd.c   | 4 ++--
  hw/vfio/listener.c  | 4 ++--
  hw/vfio/pci.c       | 9 +++++++++
  6 files changed, 17 insertions(+), 7 deletions(-)


Reviewed-by: Cédric Le Goater <c...@redhat.com>

Thanks,

C.




Reply via email to