Received: from eggs.gnu.org ([2001:4830:134:3::10]:53196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOlpa-0000yZ-7n for qemu-devel@nongnu.org; Tue, 02 Sep 2014 07:01:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOlpT-0001TZ-7r for qemu-devel@nongnu.org; Tue, 02 Sep 2014 07:00:58 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:40395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOlpT-0001TS-11 for qemu-devel@nongnu.org; Tue, 02 Sep 2014 07:00:51 -0400 From: Knut Omang Date: Tue, 2 Sep 2014 13:00:03 +0200 Message-Id: <1409655606-19150-2-git-send-email-knut.omang@oracle.com> In-Reply-To: <1409655606-19150-1-git-send-email-knut.omang@oracle.com> References: <1409655606-19150-1-git-send-email-knut.omang@oracle.com> Subject: [Qemu-devel] [PATCH v2 1/4] pci: Make use of the devfn property when registering new devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Stefan Hajnoczi , "Michael S. Tsirkin" , Laszlo Ersek , Gabriel Somlo , Knut Omang , Alexander Graf , Fabien Chouteau , Luiz Capitulino , Beniamino Galvani , Alex Williamson , "Gonglei (Arei)" , Jan Kiszka , Anthony Liguori , Paolo Bonzini , Amos Kong Without this, the devfn argument to pci_create_*() does not affect the assigned devfn. Needed to support (VF_STRIDE,VF_OFFSET) values other than (1,1) for SR/IOV. Signed-off-by: Knut Omang --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index daeaeac..6b21dee 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1757,7 +1757,7 @@ static int pci_qdev_init(DeviceState *qdev) bus = PCI_BUS(qdev_get_parent_bus(qdev)); pci_dev = do_pci_register_device(pci_dev, bus, object_get_typename(OBJECT(qdev)), - pci_dev->devfn); + object_property_get_int(OBJECT(qdev), "addr", NULL)); if (pci_dev == NULL) return -1; -- 1.9.0