[PATCH] vfio/container: Fix vfio_listener_commit()

Zhenzhong Duan posted 1 patch 5 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250609115433.401775-1-zhenzhong.duan@intel.com
Maintainers: Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>
hw/vfio/listener.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] vfio/container: Fix vfio_listener_commit()
Posted by Zhenzhong Duan 5 months, 1 week ago
It's wrong to call into listener_begin callback in vfio_listener_commit().
Currently this impacts vfio-user.

Fixes: d9b7d8b6993b ("vfio/container: pass listener_begin/commit callbacks")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 hw/vfio/listener.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c
index 203ed0314e..735b5f21b7 100644
--- a/hw/vfio/listener.c
+++ b/hw/vfio/listener.c
@@ -437,7 +437,7 @@ static void vfio_listener_commit(MemoryListener *listener)
                                                  listener);
     void (*listener_commit)(VFIOContainerBase *bcontainer);
 
-    listener_commit = VFIO_IOMMU_GET_CLASS(bcontainer)->listener_begin;
+    listener_commit = VFIO_IOMMU_GET_CLASS(bcontainer)->listener_commit;
 
     if (listener_commit) {
         listener_commit(bcontainer);
-- 
2.34.1
Re: [PATCH] vfio/container: Fix vfio_listener_commit()
Posted by Cédric Le Goater 5 months, 1 week ago
On 6/9/25 13:54, Zhenzhong Duan wrote:
> It's wrong to call into listener_begin callback in vfio_listener_commit().
> Currently this impacts vfio-user.
> 
> Fixes: d9b7d8b6993b ("vfio/container: pass listener_begin/commit callbacks")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>   hw/vfio/listener.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c
> index 203ed0314e..735b5f21b7 100644
> --- a/hw/vfio/listener.c
> +++ b/hw/vfio/listener.c
> @@ -437,7 +437,7 @@ static void vfio_listener_commit(MemoryListener *listener)
>                                                    listener);
>       void (*listener_commit)(VFIOContainerBase *bcontainer);
>   
> -    listener_commit = VFIO_IOMMU_GET_CLASS(bcontainer)->listener_begin;
> +    listener_commit = VFIO_IOMMU_GET_CLASS(bcontainer)->listener_commit;
>   
>       if (listener_commit) {
>           listener_commit(bcontainer);


Applied to vfio-next.

Thanks,

C.
Re: [PATCH] vfio/container: Fix vfio_listener_commit()
Posted by John Levon 5 months, 1 week ago
On Mon, Jun 09, 2025 at 07:54:33PM +0800, Zhenzhong Duan wrote:

> It's wrong to call into listener_begin callback in vfio_listener_commit().
> Currently this impacts vfio-user.
> 
> Fixes: d9b7d8b6993b ("vfio/container: pass listener_begin/commit callbacks")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>

D'oh, copy-and-paste error, thanks. Somewhat impressive this didn't show up as
any failure in my testing.

Reviewed-by: John Levon <john.levon@nutanix.com>

regards
john