From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33904 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZAnR-0005rZ-7v for qemu-devel@nongnu.org; Wed, 14 Jul 2010 18:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZAnQ-0004Rk-25 for qemu-devel@nongnu.org; Wed, 14 Jul 2010 18:51:21 -0400 Received: from mail-bw0-f45.google.com ([209.85.214.45]:34832) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZAnP-0004Rf-Op for qemu-devel@nongnu.org; Wed, 14 Jul 2010 18:51:20 -0400 Received: by bwz19 with SMTP id 19so283277bwz.4 for ; Wed, 14 Jul 2010 15:51:18 -0700 (PDT) Sender: Eduard - Gabriel Munteanu Date: Thu, 15 Jul 2010 01:50:14 +0300 From: Eduard - Gabriel Munteanu Subject: Re: [Qemu-devel] [RFC PATCH 3/7] pci: call IOMMU hooks Message-ID: <20100714225014.GB7065@localhost> References: <1279086307-9596-1-git-send-email-eduard.munteanu@linux360.ro> <1279086307-9596-4-git-send-email-eduard.munteanu@linux360.ro> <20100714073739.GM31689@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100714073739.GM31689@valinux.co.jp> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: joro@8bytes.org, paul@codesourcery.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, avi@redhat.com On Wed, Jul 14, 2010 at 04:37:39PM +0900, Isaku Yamahata wrote: > On Wed, Jul 14, 2010 at 08:45:03AM +0300, Eduard - Gabriel Munteanu wrote: [snip] > > PCIDevice *pci_register_device(PCIBus *bus, const char *name, > > int instance_size, int devfn, > > PCIConfigReadFunc *config_read, > > PCIConfigWriteFunc *config_write) > > { > > PCIDevice *pci_dev; > > + int err; > > > > pci_dev = qemu_mallocz(instance_size); > > pci_dev = do_pci_register_device(pci_dev, bus, name, devfn, > > @@ -747,6 +761,13 @@ PCIDevice *pci_register_device(PCIBus *bus, const char *name, > > if (pci_dev == NULL) { > > hw_error("PCI: can't register device\n"); > > } > > + > > + err = pci_iommu_register_device(bus, pci_dev); > > + if (err) { > > + hw_error("PCI: can't register device with IOMMU\n"); > > + return NULL; > > + } > > + > > return pci_dev; > > } > > pci_register_device() is pre-qdev api. > qdev'fied device doesn't call pci_register_device(). > So please move the initialization hook into do_pci_register_device() > which are commonly used by pci_register_device() and pci_qdev_init(). > -- > yamahata Thanks, I didn't need the functionality and missed this. Eduard