[PATCH] vfio: Clean up vfio_region_unmap()

Xiaoyao Li posted 1 patch 1 week, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260519063540.1117808-1-xiaoyao.li@intel.com
Maintainers: Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>
hw/vfio/region.c      | 15 ---------------
hw/vfio/vfio-region.h |  1 -
2 files changed, 16 deletions(-)
[PATCH] vfio: Clean up vfio_region_unmap()
Posted by Xiaoyao Li 1 week, 4 days ago
Since commit 7429aebe1cff ("vfio/migration: Remove VFIO migration
protocol v1"), vfio_region_unmap() lost all its callers.

Remove unused vfio_region_unmap().

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 hw/vfio/region.c      | 15 ---------------
 hw/vfio/vfio-region.h |  1 -
 2 files changed, 16 deletions(-)

diff --git a/hw/vfio/region.c b/hw/vfio/region.c
index 0342ca712acd..dbde33918026 100644
--- a/hw/vfio/region.c
+++ b/hw/vfio/region.c
@@ -468,21 +468,6 @@ no_mmap:
     return ret;
 }
 
-void vfio_region_unmap(VFIORegion *region)
-{
-    int i;
-
-    if (!region->mem) {
-        return;
-    }
-
-    for (i = 0; i < region->nr_mmaps; i++) {
-        if (region->mmaps[i].mmap) {
-            vfio_subregion_unmap(region, i);
-        }
-    }
-}
-
 void vfio_region_exit(VFIORegion *region)
 {
     int i;
diff --git a/hw/vfio/vfio-region.h b/hw/vfio/vfio-region.h
index 9b21d4ee5ba1..58b236f1133e 100644
--- a/hw/vfio/vfio-region.h
+++ b/hw/vfio/vfio-region.h
@@ -41,7 +41,6 @@ int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *region,
                       int index, const char *name, Error **errp);
 int vfio_region_mmap(VFIORegion *region);
 void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled);
-void vfio_region_unmap(VFIORegion *region);
 void vfio_region_exit(VFIORegion *region);
 void vfio_region_finalize(VFIORegion *region);
 
-- 
2.43.0
Re: [PATCH] vfio: Clean up vfio_region_unmap()
Posted by Cédric Le Goater 1 week, 2 days ago
On 5/19/26 08:35, Xiaoyao Li wrote:
> Since commit 7429aebe1cff ("vfio/migration: Remove VFIO migration
> protocol v1"), vfio_region_unmap() lost all its callers.
> 
> Remove unused vfio_region_unmap().
> 
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>


Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.


> ---
>   hw/vfio/region.c      | 15 ---------------
>   hw/vfio/vfio-region.h |  1 -
>   2 files changed, 16 deletions(-)
> 
> diff --git a/hw/vfio/region.c b/hw/vfio/region.c
> index 0342ca712acd..dbde33918026 100644
> --- a/hw/vfio/region.c
> +++ b/hw/vfio/region.c
> @@ -468,21 +468,6 @@ no_mmap:
>       return ret;
>   }
>   
> -void vfio_region_unmap(VFIORegion *region)
> -{
> -    int i;
> -
> -    if (!region->mem) {
> -        return;
> -    }
> -
> -    for (i = 0; i < region->nr_mmaps; i++) {
> -        if (region->mmaps[i].mmap) {
> -            vfio_subregion_unmap(region, i);
> -        }
> -    }
> -}
> -
>   void vfio_region_exit(VFIORegion *region)
>   {
>       int i;
> diff --git a/hw/vfio/vfio-region.h b/hw/vfio/vfio-region.h
> index 9b21d4ee5ba1..58b236f1133e 100644
> --- a/hw/vfio/vfio-region.h
> +++ b/hw/vfio/vfio-region.h
> @@ -41,7 +41,6 @@ int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *region,
>                         int index, const char *name, Error **errp);
>   int vfio_region_mmap(VFIORegion *region);
>   void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled);
> -void vfio_region_unmap(VFIORegion *region);
>   void vfio_region_exit(VFIORegion *region);
>   void vfio_region_finalize(VFIORegion *region);
>