[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Report stringified errno in VFIO related errors

From: Michal Privoznik
Subject: Re: [PATCH] Report stringified errno in VFIO related errors
Date: Fri, 14 Feb 2020 10:52:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2

On 2/14/20 10:47 AM, Cornelia Huck wrote:
On Fri, 14 Feb 2020 09:47:39 +0100
Michal Privoznik <address@hidden> 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 <address@hidden>
  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 
          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().

Indeed, will send v2.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]