qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Klaus Jensen <its@irrelevant.dk>, qemu-devel@nongnu.org
Cc: Keith Busch <kbusch@kernel.org>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-block@nongnu.org, Klaus Jensen <k.jensen@samsung.com>
Subject: Re: [PATCH v3 2/2] hw/nvme: cleanup error reporting in nvme_init_pci()
Date: Fri, 11 Nov 2022 12:40:07 +0100	[thread overview]
Message-ID: <bfc67412-09ce-793e-49ac-b0af0cf05fbd@linaro.org> (raw)
In-Reply-To: <20221110220805.26816-3-its@irrelevant.dk>

On 10/11/22 23:08, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> Replace the local Error variable with errp and ERRP_GUARD() and change
> the return value to bool.
> 
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
>   hw/nvme/ctrl.c | 23 ++++++++++-------------
>   1 file changed, 10 insertions(+), 13 deletions(-)


> @@ -7388,14 +7387,12 @@ static int nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)
>       }
>       ret = msix_init(pci_dev, n->params.msix_qsize,
>                       &n->bar0, 0, msix_table_offset,
> -                    &n->bar0, 0, msix_pba_offset, 0, &err);
> -    if (ret < 0) {
> -        if (ret == -ENOTSUP) {
> -            warn_report_err(err);
> -        } else {
> -            error_propagate(errp, err);
> -            return ret;
> -        }
> +                    &n->bar0, 0, msix_pba_offset, 0, errp);
> +    if (ret == -ENOTSUP) {
> +        warn_report_err(*errp);

Why only report ENOTSUP in particular?

> +        *errp = NULL;
> +    } else if (ret < 0) {
 > +        return false;

Is that normal to ignore:

-   error_setg(errp, "The number of MSI-X vectors is invalid");
     return -EINVAL;

-   error_setg(errp, "table & pba overlap, or they don't fit in BARs,"
                      " or don't align");
     return -EINVAL;

Or possible future error added in msix_init()?


  reply	other threads:[~2022-11-11 11:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 22:08 [PATCH v3 0/2] hw/nvme: errp fixes Klaus Jensen
2022-11-10 22:08 ` [PATCH v3 1/2] hw/nvme: fix incorrect use of errp/local_err Klaus Jensen
2022-11-11  6:36   ` Markus Armbruster
2022-11-11  6:41     ` Klaus Jensen
2022-11-11  6:55       ` Markus Armbruster
2022-11-11  7:09         ` Klaus Jensen
2022-11-11 11:17           ` Markus Armbruster
2022-11-10 22:08 ` [PATCH v3 2/2] hw/nvme: cleanup error reporting in nvme_init_pci() Klaus Jensen
2022-11-11 11:40   ` Philippe Mathieu-Daudé [this message]
2022-11-11 12:32     ` Klaus Jensen
2022-11-11 12:56       ` Philippe Mathieu-Daudé

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=bfc67412-09ce-793e-49ac-b0af0cf05fbd@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=qemu-block@nongnu.org \
    --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).