summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2025-02-06 14:14:31 +0100
committerCédric Le Goater <clg@redhat.com>2025-02-11 14:15:19 +0100
commitcdc6f2e0c9fcef2027f4fc5f25ddd15e36283e90 (patch)
treefa89ad37507de07312b640034e88f3e36c1fa434
parentcbfbedd6173cf8ff3f374ec6b8e1a17e9fa75872 (diff)
downloadfocaccia-qemu-cdc6f2e0c9fcef2027f4fc5f25ddd15e36283e90.tar.gz
focaccia-qemu-cdc6f2e0c9fcef2027f4fc5f25ddd15e36283e90.zip
vfio: Rephrase comment in vfio_listener_region_add() error path
Rephrase a bit the ending comment about how errors are handled
depending on the phase in which vfio_listener_region_add() is called.

Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250206131438.1505542-4-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r--hw/vfio/common.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index f7499a9b74..62af1216fc 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -683,12 +683,13 @@ fail:
         error_reportf_err(err, "PCI p2p may not work: ");
         return;
     }
-    /*
-     * On the initfn path, store the first error in the container so we
-     * can gracefully fail.  Runtime, there's not much we can do other
-     * than throw a hardware error.
-     */
+
     if (!bcontainer->initialized) {
+        /*
+         * At machine init time or when the device is attached to the
+         * VM, store the first error in the container so we can
+         * gracefully fail the device realize routine.
+         */
         if (!bcontainer->error) {
             error_propagate_prepend(&bcontainer->error, err,
                                     "Region %s: ",
@@ -697,6 +698,10 @@ fail:
             error_free(err);
         }
     } else {
+        /*
+         * At runtime, there's not much we can do other than throw a
+         * hardware error.
+         */
         error_report_err(err);
         hw_error("vfio: DMA mapping failed, unable to continue");
     }