[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/10] vfio/iommufd: Return errno in iommufd_cdev_attach_i
From: |
Joao Martins |
Subject: |
Re: [PATCH v3 03/10] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt() |
Date: |
Mon, 8 Jul 2024 17:28:54 +0100 |
On 08/07/2024 16:32, Joao Martins wrote:
> On 08/07/2024 16:28, Cédric Le Goater wrote:
>> Hello Joao,
>>
>> On 7/8/24 4:34 PM, Joao Martins wrote:
>>> 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.
>>
>> Please leave the return value as a bool unless there is a very
>> good reason not to.
>>
>
> Error* doesn't store the errno, and thus I can't actually test the number of
> errno to know when to bail to the next hwpt. Maybe the commit message wasn't
> clear enough there. But not sure if we have an alternative here? Or maybe
> Error
> does store errno, and I totally missed it.
Or I can just use 'errno' and keep the same return value as bool. But I didn't
do that because we are purposedly calling error_set*(errp, errno) with the errno
value that it felt the right thing to just return it. Also, considering how hard
the code in util/error.c saves/restores errno in all the helpers.
Joao
- Re: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on IOMMU_GET_HW_INFO failure, (continued)
- Re: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on IOMMU_GET_HW_INFO failure, Joao Martins, 2024/07/09
- RE: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on IOMMU_GET_HW_INFO failure, Duan, Zhenzhong, 2024/07/09
- Re: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on IOMMU_GET_HW_INFO failure, Joao Martins, 2024/07/10
- RE: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on IOMMU_GET_HW_INFO failure, Duan, Zhenzhong, 2024/07/10
- Re: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on IOMMU_GET_HW_INFO failure, Joao Martins, 2024/07/10
[PATCH v3 02/10] backends/iommufd: Extend iommufd_backend_get_device_info() to fetch HW capabilities, Joao Martins, 2024/07/08
[PATCH v3 03/10] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt(), Joao Martins, 2024/07/08
[PATCH v3 04/10] vfio/iommufd: Introduce auto domain creation, Joao Martins, 2024/07/08
[PATCH v3 05/10] vfio/iommufd: Probe and request hwpt dirty tracking capability, Joao Martins, 2024/07/08