Skip to contentSkip to conversation

vfio/container: Fix vfio_listener_commit()

PATCH Applied Zhenzhong Duan 3 participants 3 messages Jun 9, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio/container: Fix vfio_listener_commit()

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")
---
 hw/vfio/listener.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/listener.c +1 -1
index 203ed0314e..735b5f21b7 100644
@@ -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);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Zhenzhong Duan

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")

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

regards
john

#2 lore raw
In reply to Zhenzhong Duan
Quoted 14 lines · Zhenzhong Duan

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")
---
  hw/vfio/listener.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/listener.c +0 -0
index 203ed0314e..735b5f21b7 100644

hw/vfio/listener.c static void vfio_listener_commit(MemoryListener *listener) · line 443

Quoted 8 lines
hw/vfio/listener.c +1 -1
@@ -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.