qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Alex Williamson" <alex.williamson@redhat.com>,
	"Cédric Le Goater" <clg@redhat.com>
Subject: [PATCH v3 3/7] vfio: Rephrase comment in vfio_listener_region_add() error path
Date: Thu,  6 Feb 2025 14:14:31 +0100	[thread overview]
Message-ID: <20250206131438.1505542-4-clg@redhat.com> (raw)
In-Reply-To: <20250206131438.1505542-1-clg@redhat.com>

Rephrase a bit the ending comment about how errors are handled
depending on the phase in which vfio_listener_region_add() is called.

Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/vfio/common.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index f7499a9b7447a7593198e1523c50858b70a8bd85..62af1216fc5a9089fc718c2afe3a405d9381db32 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");
     }
-- 
2.48.1



  parent reply	other threads:[~2025-02-06 13:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 13:14 [PATCH v3 0/7] vfio: Improve error reporting when MMIO region mapping fails Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 1/7] util/error: Introduce warn_report_err_once() Cédric Le Goater
2025-02-10 16:26   ` Cédric Le Goater
2025-02-11  6:53     ` Markus Armbruster
2025-02-06 13:14 ` [PATCH v3 2/7] vfio/pci: Replace "iommu_device" by "vIOMMU" Cédric Le Goater
2025-02-06 13:14 ` Cédric Le Goater [this message]
2025-02-06 13:14 ` [PATCH v3 4/7] vfio: Introduce vfio_get_vfio_device() Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 5/7] vfio: Improve error reporting when MMIO region mapping fails Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 6/7] vfio: Remove reports of DMA mapping errors in backends Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 7/7] vfio: Remove superfluous error report in vfio_listener_region_add() Cédric Le Goater
2025-02-06 15:07   ` Harsh Prateek Bora
2025-02-10 16:01 ` [PATCH v3 0/7] vfio: Improve error reporting when MMIO region mapping fails Alex Williamson
2025-02-11 13:32 ` Cédric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250206131438.1505542-4-clg@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).