From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNhxJ-0001Nl-MT for qemu-devel@nongnu.org; Mon, 15 Oct 2012 06:31:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNhxD-0001K7-Tu for qemu-devel@nongnu.org; Mon, 15 Oct 2012 06:31:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNhxD-0001K3-LR for qemu-devel@nongnu.org; Mon, 15 Oct 2012 06:31:23 -0400 Message-ID: <507BE5F2.5010606@redhat.com> Date: Mon, 15 Oct 2012 12:31:14 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1349962023-560-1-git-send-email-avi@redhat.com> <1349962023-560-5-git-send-email-avi@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v1 4/7] pci: switch iommu to using the memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: "Michael S. Tsirkin" , liu ping fan , qemu-devel@nongnu.org, Alex Williamson , Anthony Liguori , Paolo Bonzini 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