On Fri, Nov 22, 2019 at 07:29:28PM +0100, Eric Auger wrote: > +typedef struct viommu_domain { > + uint32_t id; > + GTree *mappings; > + QLIST_HEAD(, viommu_endpoint) endpoint_list; > +} viommu_domain; > + > +typedef struct viommu_endpoint { > + uint32_t id; > + viommu_domain *domain; > + QLIST_ENTRY(viommu_endpoint) next; > +} viommu_endpoint;
There might be a way to merge viommu_endpoint and the IOMMUDevice structure introduced in patch 4, since they both represent one endpoint. Maybe virtio_iommu_find_add_pci_as() could add the IOMMUDevice to s->endpoints, and IOMMUDevice could store the endpoint ID rather than bus and devfn. > +typedef struct viommu_interval { > + uint64_t low; > + uint64_t high; > +} viommu_interval; I guess these should be named in CamelCase? Although if we're allowed to choose my vote goes to underscores :) Thanks, Jean