diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2020-02-14 10:55:19 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-02-18 20:20:49 +0100 |
commit | b09d51c9098adec9c83cc0d8332d03e052844a9f (patch) | |
tree | b70d6f40424e79deecd5690822902c4d254e90f4 /hw/vfio | |
parent | 4065bb25e95f7059b250ed8194a46bced9a7602b (diff) |
Report stringified errno in VFIO related errors
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Message-Id: <4949c3ecf1a32189b8a4b5eb4b0fd04c1122501d.1581674006.git.mprivozn@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/vfio')
-rw-r--r-- | hw/vfio/common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 5ca11488d6..0b3593b3c0 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -319,7 +319,7 @@ static int vfio_dma_unmap(VFIOContainer *container, unmap.size -= 1ULL << ctz64(container->pgsizes); continue; } - error_report("VFIO_UNMAP_DMA: %d", -errno); + error_report("VFIO_UNMAP_DMA failed: %s", strerror(errno)); return -errno; } @@ -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; } |