qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v4 22/24] vfio/pci: Adapt vfio pci hot reset support with


From: Nicolin Chen
Subject: Re: [RFC PATCH v4 22/24] vfio/pci: Adapt vfio pci hot reset support with iommufd BE
Date: Wed, 16 Aug 2023 22:25:32 -0700

On Wed, Jul 12, 2023 at 03:25:26PM +0800, Zhenzhong Duan wrote:
 
> +#ifdef CONFIG_IOMMUFD
> +static VFIODevice *vfio_pci_iommufd_binded(__u32 devid)
> +{
> +    VFIOAddressSpace *space;
> +    VFIOContainer *bcontainer;
> +    VFIOIOMMUFDContainer *container;
> +    VFIOIOASHwpt *hwpt;
> +    VFIODevice *vbasedev_iter;
> +    VFIOIOMMUBackendOpsClass *ops = VFIO_IOMMU_BACKEND_OPS_CLASS(
> +        object_class_by_name(TYPE_VFIO_IOMMU_BACKEND_IOMMUFD_OPS));
> +
> +     QLIST_FOREACH(space, &vfio_address_spaces, list) {

Indentation here doesn't seem to be aligned with the lines above. 

> +        QLIST_FOREACH(bcontainer, &space->containers, next) {
> +            if (bcontainer->ops != ops) {
> +                continue;
> +            }
> +            container = container_of(bcontainer, VFIOIOMMUFDContainer,
> +                                     bcontainer);
> +            QLIST_FOREACH(hwpt, &container->hwpt_list, next) {
> +                QLIST_FOREACH(vbasedev_iter, &hwpt->device_list, next) {
> +                    if (devid == vbasedev_iter->devid) {
> +                        return vbasedev_iter;
> +                    }
> +                }
> +            }
> +        }
> +    }
> +    return NULL;
> +}

By a quick look, the "binded" sounds a bit odd to me. And this
function could be vfio_pci_find_by_iommufd_devid()?

Thanks
Nicolin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]