[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 23/27] vfio/platform: Move VFIODevice initializations in vfio_
From: |
Zhenzhong Duan |
Subject: |
[PATCH v7 23/27] vfio/platform: Move VFIODevice initializations in vfio_platform_instance_init |
Date: |
Tue, 21 Nov 2023 16:44:22 +0800 |
Some of the VFIODevice initializations is in vfio_platform_realize,
move all of them in vfio_platform_instance_init.
No functional change intended.
Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/platform.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index a97d9c6234..506eb8193f 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -581,10 +581,6 @@ static void vfio_platform_realize(DeviceState *dev, Error
**errp)
VFIODevice *vbasedev = &vdev->vbasedev;
int i, ret;
- vbasedev->type = VFIO_DEVICE_TYPE_PLATFORM;
- vbasedev->dev = dev;
- vbasedev->ops = &vfio_platform_ops;
-
qemu_mutex_init(&vdev->intp_mutex);
trace_vfio_platform_realize(vbasedev->sysfsdev ?
@@ -659,8 +655,12 @@ static Property vfio_platform_dev_properties[] = {
static void vfio_platform_instance_init(Object *obj)
{
VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(obj);
+ VFIODevice *vbasedev = &vdev->vbasedev;
- vdev->vbasedev.fd = -1;
+ vbasedev->type = VFIO_DEVICE_TYPE_PLATFORM;
+ vbasedev->ops = &vfio_platform_ops;
+ vbasedev->dev = DEVICE(vdev);
+ vbasedev->fd = -1;
}
#ifdef CONFIG_IOMMUFD
--
2.34.1
- [PATCH v7 11/27] vfio/pci: Make vfio cdev pre-openable by passing a file handle, (continued)
- [PATCH v7 11/27] vfio/pci: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/21
- [PATCH v7 13/27] vfio/platform: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/21
- [PATCH v7 14/27] vfio/ap: Allow the selection of a given iommu backend, Zhenzhong Duan, 2023/11/21
- [PATCH v7 15/27] vfio/ap: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/21
- [PATCH v7 12/27] vfio/platform: Allow the selection of a given iommu backend, Zhenzhong Duan, 2023/11/21
- [PATCH v7 16/27] vfio/ccw: Allow the selection of a given iommu backend, Zhenzhong Duan, 2023/11/21
- [PATCH v7 17/27] vfio/ccw: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/21
- [PATCH v7 19/27] hw/arm: Activate IOMMUFD for virt machines, Zhenzhong Duan, 2023/11/21
- [PATCH v7 18/27] vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks, Zhenzhong Duan, 2023/11/21
- [PATCH v7 20/27] kconfig: Activate IOMMUFD for s390x machines, Zhenzhong Duan, 2023/11/21
- [PATCH v7 23/27] vfio/platform: Move VFIODevice initializations in vfio_platform_instance_init,
Zhenzhong Duan <=
- [PATCH v7 22/27] vfio/pci: Move VFIODevice initializations in vfio_instance_init, Zhenzhong Duan, 2023/11/21
- [PATCH v7 24/27] vfio/ap: Move VFIODevice initializations in vfio_ap_instance_init, Zhenzhong Duan, 2023/11/21
- [PATCH v7 25/27] vfio/ccw: Move VFIODevice initializations in vfio_ccw_instance_init, Zhenzhong Duan, 2023/11/21
- [PATCH v7 21/27] hw/i386: Activate IOMMUFD for q35 machines, Zhenzhong Duan, 2023/11/21
- [PATCH v7 27/27] docs/devel: Add VFIO iommufd backend documentation, Zhenzhong Duan, 2023/11/21
- [PATCH v7 26/27] vfio: Introduce a helper function to initialize VFIODevice, Zhenzhong Duan, 2023/11/21
- Re: [PATCH v7 00/27] vfio: Adopt iommufd, Cédric Le Goater, 2023/11/21