mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
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>
This commit is contained in:
parent
c12b55ad6f
commit
6106a32914
6 changed files with 21 additions and 20 deletions
|
@ -657,10 +657,8 @@ static void vfio_platform_instance_init(Object *obj)
|
|||
VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(obj);
|
||||
VFIODevice *vbasedev = &vdev->vbasedev;
|
||||
|
||||
vbasedev->type = VFIO_DEVICE_TYPE_PLATFORM;
|
||||
vbasedev->ops = &vfio_platform_ops;
|
||||
vbasedev->dev = DEVICE(vdev);
|
||||
vbasedev->fd = -1;
|
||||
vfio_device_init(vbasedev, VFIO_DEVICE_TYPE_PLATFORM, &vfio_platform_ops,
|
||||
DEVICE(vdev), false);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IOMMUFD
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue