From: Cornelia Huck <cohuck@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
alex.williamson@redhat.com
Subject: Re: [PATCH] Report stringified errno in VFIO related errors
Date: Fri, 14 Feb 2020 10:47:40 +0100 [thread overview]
Message-ID: <20200214104740.07f59c72.cohuck@redhat.com> (raw)
In-Reply-To: <2dc5a0962a38b912e4fa4900f9813b7ea1a9273c.1581670009.git.mprivozn@redhat.com>
On Fri, 14 Feb 2020 09:47:39 +0100
Michal Privoznik <mprivozn@redhat.com> wrote:
> In a few places we report errno formatted as a negative integer.
> This is not as user friendly as it can be. Use strerror() and/or
> error_setg_errno() instead.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> hw/vfio/common.c | 2 +-
> util/vfio-helpers.c | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 5ca11488d6..a3a2a82d99 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -352,7 +352,7 @@ static int vfio_dma_map(VFIOContainer *container, hwaddr iova,
> return 0;
> }
>
> - error_report("VFIO_MAP_DMA: %d", -errno);
> + error_report("VFIO_MAP_DMA failed: %s", strerror(errno));
> return -errno;
> }
I think you missed the one in vfio_dma_unmap().
(...)
The other file looks good.
WARNING: multiple messages have this Message-ID (diff)
From: Cornelia Huck <cohuck@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>
Cc: qemu-trivial@nongnu.org, alex.williamson@redhat.com,
qemu-devel@nongnu.org
Subject: Re: [PATCH] Report stringified errno in VFIO related errors
Date: Fri, 14 Feb 2020 10:47:40 +0100 [thread overview]
Message-ID: <20200214104740.07f59c72.cohuck@redhat.com> (raw)
In-Reply-To: <2dc5a0962a38b912e4fa4900f9813b7ea1a9273c.1581670009.git.mprivozn@redhat.com>
On Fri, 14 Feb 2020 09:47:39 +0100
Michal Privoznik <mprivozn@redhat.com> wrote:
> In a few places we report errno formatted as a negative integer.
> This is not as user friendly as it can be. Use strerror() and/or
> error_setg_errno() instead.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> hw/vfio/common.c | 2 +-
> util/vfio-helpers.c | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 5ca11488d6..a3a2a82d99 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -352,7 +352,7 @@ static int vfio_dma_map(VFIOContainer *container, hwaddr iova,
> return 0;
> }
>
> - error_report("VFIO_MAP_DMA: %d", -errno);
> + error_report("VFIO_MAP_DMA failed: %s", strerror(errno));
> return -errno;
> }
I think you missed the one in vfio_dma_unmap().
(...)
The other file looks good.
next prev parent reply other threads:[~2020-02-14 9:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 8:47 [PATCH] Report stringified errno in VFIO related errors Michal Privoznik
2020-02-14 8:47 ` Michal Privoznik
2020-02-14 9:09 ` Ján Tomko
2020-02-14 9:09 ` Ján Tomko
2020-02-14 9:19 ` Michal Privoznik
2020-02-14 11:48 ` Philippe Mathieu-Daudé
2020-02-14 11:48 ` Philippe Mathieu-Daudé
2020-02-14 15:49 ` Alex Williamson
2020-02-14 16:23 ` Michal Privoznik
2020-02-14 9:47 ` Cornelia Huck [this message]
2020-02-14 9:47 ` Cornelia Huck
2020-02-14 9:52 ` Michal Privoznik
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=20200214104740.07f59c72.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=mprivozn@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.