On 10/13/2012 11:13 AM, Blue Swirl wrote: >> struct PCIBus { >> BusState qbus; >> - PCIDMAContextFunc dma_context_fn; >> - void *dma_context_opaque; >> + PCIIOMMUFunc iommu_fn; >> + PCIIOMMUDestructorFunc iommu_dtor_fn; >> + void *iommu_opaque; > > Maybe the opaque could be avoided (in later patches) by clever use of > container_of() by the functions to get the parent structure?
Indeed yes. This requires replacing pci_bus_new() and pci_register_bus() by a conventional pci_bus_init(). I think it's the right direction to move and the memory API always uses caller-managed allocation and objects, instead of API-managed allocation and pointers/handles. -- error compiling committee.c: too many arguments to function