[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/16] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt
From: |
Cédric Le Goater |
Subject: |
[PULL 05/16] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt() |
Date: |
Tue, 23 Jul 2024 16:00:08 +0200 |
From: Joao Martins <joao.m.martins@oracle.com>
In preparation to implement auto domains have the attach function
return the errno it got during domain attach instead of a bool.
-EINVAL is tracked to track domain incompatibilities, and decide whether
to create a new IOMMU domain.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
hw/vfio/iommufd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index
7c1b9e0284a3e84f68d13031cd517bffc47376d8..7390621ee92762c5d752c0fae907e71380b6e980
100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
@@ -172,7 +172,7 @@ out:
return ret;
}
-static bool iommufd_cdev_attach_ioas_hwpt(VFIODevice *vbasedev, uint32_t id,
+static int iommufd_cdev_attach_ioas_hwpt(VFIODevice *vbasedev, uint32_t id,
Error **errp)
{
int iommufd = vbasedev->iommufd->fd;
@@ -187,12 +187,12 @@ static bool iommufd_cdev_attach_ioas_hwpt(VFIODevice
*vbasedev, uint32_t id,
error_setg_errno(errp, errno,
"[iommufd=%d] error attach %s (%d) to id=%d",
iommufd, vbasedev->name, vbasedev->fd, id);
- return false;
+ return -errno;
}
trace_iommufd_cdev_attach_ioas_hwpt(iommufd, vbasedev->name,
vbasedev->fd, id);
- return true;
+ return 0;
}
static bool iommufd_cdev_detach_ioas_hwpt(VFIODevice *vbasedev, Error **errp)
@@ -216,7 +216,7 @@ static bool iommufd_cdev_attach_container(VFIODevice
*vbasedev,
VFIOIOMMUFDContainer *container,
Error **errp)
{
- return iommufd_cdev_attach_ioas_hwpt(vbasedev, container->ioas_id, errp);
+ return !iommufd_cdev_attach_ioas_hwpt(vbasedev, container->ioas_id, errp);
}
static void iommufd_cdev_detach_container(VFIODevice *vbasedev,
--
2.45.2
- [PULL 00/16] vfio queue, Cédric Le Goater, 2024/07/23
- [PULL 01/16] hw/vfio/container: Fix SIGSEV on vfio_container_instance_finalize(), Cédric Le Goater, 2024/07/23
- [PULL 02/16] vfio/pci: Extract mdev check into an helper, Cédric Le Goater, 2024/07/23
- [PULL 04/16] backends/iommufd: Extend iommufd_backend_get_device_info() to fetch HW capabilities, Cédric Le Goater, 2024/07/23
- [PULL 03/16] vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev, Cédric Le Goater, 2024/07/23
- [PULL 05/16] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt(),
Cédric Le Goater <=
- [PULL 06/16] vfio/ap: Don't initialize HOST_IOMMU_DEVICE with mdev, Cédric Le Goater, 2024/07/23
- [PULL 07/16] vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev, Cédric Le Goater, 2024/07/23
- [PULL 08/16] vfio/iommufd: Introduce auto domain creation, Cédric Le Goater, 2024/07/23
- [PULL 09/16] vfio/{iommufd,container}: Remove caps::aw_bits, Cédric Le Goater, 2024/07/23
- [PULL 10/16] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps, Cédric Le Goater, 2024/07/23
- [PULL 12/16] vfio/iommufd: Probe and request hwpt dirty tracking capability, Cédric Le Goater, 2024/07/23
- [PULL 11/16] vfio/{iommufd, container}: Invoke HostIOMMUDevice::realize() during attach_device(), Cédric Le Goater, 2024/07/23
- [PULL 13/16] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support, Cédric Le Goater, 2024/07/23
- Re: [PULL 00/16] vfio queue, Cédric Le Goater, 2024/07/23