From b09d51c9098adec9c83cc0d8332d03e052844a9f Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 14 Feb 2020 10:55:19 +0100 Subject: Report stringified errno in VFIO related errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko Reviewed-by: Cornelia Huck Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Williamson Message-Id: <4949c3ecf1a32189b8a4b5eb4b0fd04c1122501d.1581674006.git.mprivozn@redhat.com> Signed-off-by: Laurent Vivier --- hw/vfio/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw') 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; } -- cgit v1.2.3