aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/common.c
diff options
context:
space:
mode:
authorAvihai Horon <avihaih@nvidia.com>2023-03-07 12:54:36 +0000
committerAlex Williamson <alex.williamson@redhat.com>2023-03-07 07:20:32 -0700
commit3e2413a6520e5b6d8360395b6b423332abfb3362 (patch)
treef3e4f0906299c77f2b1c63c05905da8570984e2d /hw/vfio/common.c
parentc29a2f40cd5d1fdad4632b48343cd968db041a44 (diff)
vfio/common: Fix error reporting in vfio_get_dirty_bitmap()
Return -errno instead of -1 if VFIO_IOMMU_DIRTY_PAGES ioctl fails in vfio_get_dirty_bitmap(). Signed-off-by: Avihai Horon <avihaih@nvidia.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/r/20230307125450.62409-2-joao.m.martins@oracle.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio/common.c')
-rw-r--r--hw/vfio/common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index bab83c0e55..9fc305448f 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1335,6 +1335,7 @@ static int vfio_get_dirty_bitmap(VFIOContainer *container, uint64_t iova,
ret = ioctl(container->fd, VFIO_IOMMU_DIRTY_PAGES, dbitmap);
if (ret) {
+ ret = -errno;
error_report("Failed to get dirty bitmap for iova: 0x%"PRIx64
" size: 0x%"PRIx64" err: %d", (uint64_t)range->iova,
(uint64_t)range->size, errno);