aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/pci.c
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2023-11-21 16:44:25 +0800
committerCédric Le Goater <clg@redhat.com>2023-12-19 19:03:38 +0100
commit6106a329141af7d47bdc3346ce9820d4714e0e5d (patch)
tree3de9916a47b3940bab139bdc3802ffafbae8073e /hw/vfio/pci.c
parentc12b55ad6f9d3b4792b590e9211bd7319e4a2d70 (diff)
downloadqemu-6106a329141af7d47bdc3346ce9820d4714e0e5d.zip
qemu-6106a329141af7d47bdc3346ce9820d4714e0e5d.tar.gz
qemu-6106a329141af7d47bdc3346ce9820d4714e0e5d.tar.bz2
vfio: Introduce a helper function to initialize VFIODevice
Introduce a helper function to replace the common code to initialize VFIODevice in pci, platform, ap and ccw VFIO device. No functional change intended. Suggested-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio/pci.c')
-rw-r--r--hw/vfio/pci.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 8740558..1874ec1 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3327,10 +3327,8 @@ static void vfio_instance_init(Object *obj)
vdev->host.slot = ~0U;
vdev->host.function = ~0U;
- vbasedev->type = VFIO_DEVICE_TYPE_PCI;
- vbasedev->ops = &vfio_pci_ops;
- vbasedev->dev = DEVICE(vdev);
- vbasedev->fd = -1;
+ vfio_device_init(vbasedev, VFIO_DEVICE_TYPE_PCI, &vfio_pci_ops,
+ DEVICE(vdev), false);
vdev->nv_gpudirect_clique = 0xFF;