[PULL 07/31] vfio/container: set error on cpr failure

Cédric Le Goater posted 31 patches 1 day, 9 hours ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, John Levon <john.levon@nutanix.com>, Thanos Makatos <thanos.makatos@nutanix.com>, "Cédric Le Goater" <clg@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, Steve Sistare <steven.sistare@oracle.com>, Tomita Moeko <tomitamoeko@gmail.com>
There is a newer version of this series
[PULL 07/31] vfio/container: set error on cpr failure
Posted by Cédric Le Goater 1 day, 9 hours ago
From: Steve Sistare <steven.sistare@oracle.com>

Set an error message if vfio_cpr_ram_discard_register_listener fails so
the fail label gets a valid error object.

Reported-by: Cédric Le Goater <clg@redhat.com>
Fixes: eba1f657cbb1 ("vfio/container: recover from unmap-all-vaddr failure")
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/1755094667-281419-1-git-send-email-steven.sistare@oracle.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/vfio/listener.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c
index f498e23a93747cb1826726f7c4ca28f8128b4ced..5ebafaa07ea15070dfbe299d3f2c0f265959fb7d 100644
--- a/hw/vfio/listener.c
+++ b/hw/vfio/listener.c
@@ -574,6 +574,9 @@ void vfio_container_region_add(VFIOContainerBase *bcontainer,
             vfio_ram_discard_register_listener(bcontainer, section);
         } else if (!vfio_cpr_ram_discard_register_listener(bcontainer,
                                                            section)) {
+            error_setg(&err,
+                       "vfio_cpr_ram_discard_register_listener for %s failed",
+                       memory_region_name(section->mr));
             goto fail;
         }
         return;
-- 
2.51.0