qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 14/22] vfio/common: Simplify vfio_viommu_preset()


From: Cédric Le Goater
Subject: Re: [PATCH v1 14/22] vfio/common: Simplify vfio_viommu_preset()
Date: Tue, 19 Sep 2023 18:01:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 8/30/23 12:37, Zhenzhong Duan wrote:
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>

This looks like a revert of patch 07. Can it be avoided in v2 ?

Thanks,

C.

---
  hw/vfio/common.c | 17 +----------------
  1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 86b6af5740..6c3e98d5fd 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -165,22 +165,7 @@ void vfio_unblock_multiple_devices_migration(void)
bool vfio_viommu_preset(VFIODevice *vbasedev)
  {
-    VFIOAddressSpace *space;
-    VFIOContainer *container;
-    VFIODevice *tmp_dev;
-
-    QLIST_FOREACH(space, &vfio_address_spaces, list) {
-        QLIST_FOREACH(container, &space->containers, next) {
-            tmp_dev = NULL;
-            while ((tmp_dev = vfio_container_dev_iter_next(container,
-                                                           tmp_dev))) {
-                if (vbasedev == tmp_dev) {
-                    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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]