diff options
-rw-r--r-- | hw/vfio/common.c | 4 | ||||
-rw-r--r-- | util/vfio-helpers.c | 6 |
2 files changed, 5 insertions, 5 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; } diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 813f7ec564..ddd9a96e76 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -545,7 +545,7 @@ static int qemu_vfio_do_mapping(QEMUVFIOState *s, void *host, size_t size, trace_qemu_vfio_do_mapping(s, host, size, iova); if (ioctl(s->container, VFIO_IOMMU_MAP_DMA, &dma_map)) { - error_report("VFIO_MAP_DMA: %d", -errno); + error_report("VFIO_MAP_DMA failed: %s", strerror(errno)); return -errno; } return 0; @@ -570,7 +570,7 @@ static void qemu_vfio_undo_mapping(QEMUVFIOState *s, IOVAMapping *mapping, assert(QEMU_IS_ALIGNED(mapping->size, qemu_real_host_page_size)); assert(index >= 0 && index < s->nr_mappings); if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) { - error_setg(errp, "VFIO_UNMAP_DMA failed: %d", -errno); + error_setg_errno(errp, errno, "VFIO_UNMAP_DMA failed"); } memmove(mapping, &s->mappings[index + 1], sizeof(s->mappings[0]) * (s->nr_mappings - index - 1)); @@ -669,7 +669,7 @@ int qemu_vfio_dma_reset_temporary(QEMUVFIOState *s) trace_qemu_vfio_dma_reset_temporary(s); qemu_mutex_lock(&s->lock); if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) { - error_report("VFIO_UNMAP_DMA: %d", -errno); + error_report("VFIO_UNMAP_DMA failed: %s", strerror(errno)); qemu_mutex_unlock(&s->lock); return -errno; } |