[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v4 16/24] vfio/as: Simplify vfio_viommu_preset()
From: |
Zhenzhong Duan |
Subject: |
[RFC PATCH v4 16/24] vfio/as: Simplify vfio_viommu_preset() |
Date: |
Wed, 12 Jul 2023 15:25:20 +0800 |
Commit "vfio/container-base: Introduce [attach/detach]_device container
callbacks"
add support to link to address space, we can utilize it to simplify
vfio_viommu_preset().
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
hw/vfio/as.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/hw/vfio/as.c b/hw/vfio/as.c
index 0a2363f437..a7179403b7 100644
--- a/hw/vfio/as.c
+++ b/hw/vfio/as.c
@@ -161,22 +161,7 @@ void vfio_unblock_multiple_devices_migration(void)
bool vfio_viommu_preset(VFIODevice *vbasedev)
{
- VFIOAddressSpace *space;
- VFIOContainer *container;
- VFIODevice *tmp_vbasedev;
-
- QLIST_FOREACH(space, &vfio_address_spaces, list) {
- QLIST_FOREACH(container, &space->containers, next) {
- tmp_vbasedev = NULL;
- while ((vbasedev = vfio_container_dev_iter_next(container,
- vbasedev))) {
- if (vbasedev == tmp_vbasedev) {
- return space->as != &address_space_memory;
- }
- }
- }
- }
- g_assert_not_reached();
+ return vbasedev->container->space->as != &address_space_memory;
}
static void vfio_set_migration_error(int err)
--
2.34.1
- [RFC PATCH v4 09/24] vfio/common: Rename into as.c, (continued)
- [RFC PATCH v4 09/24] vfio/common: Rename into as.c, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 08/24] vfio/common: Move legacy VFIO backend code into separate container.c, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 11/24] vfio/container: Introduce vfio_[attach/detach]_device, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 12/24] vfio/platform: Use vfio_[attach/detach]_device, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 10/24] vfio: Add base container, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 15/24] vfio/container-base: Introduce [attach/detach]_device container callbacks, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 14/24] vfio/ccw: Use vfio_[attach/detach]_device, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 17/24] Add iommufd configure option, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 13/24] vfio/ap: Use vfio_[attach/detach]_device, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 18/24] backends/iommufd: Introduce the iommufd object, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 16/24] vfio/as: Simplify vfio_viommu_preset(),
Zhenzhong Duan <=
- [RFC PATCH v4 19/24] util/char_dev: Add open_cdev(), Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 22/24] vfio/pci: Adapt vfio pci hot reset support with iommufd BE, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 20/24] vfio/iommufd: Implement the iommufd backend, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 21/24] vfio/as: Add vfio device iterator callback for iommufd, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 24/24] vfio/iommufd: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/07/12
- [RFC PATCH v4 23/24] vfio/as: Allow the selection of a given iommu backend, Zhenzhong Duan, 2023/07/12