From patchwork Tue Sep 2 11:00:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Knut Omang X-Patchwork-Id: 385073 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EA68B14018A for ; Tue, 2 Sep 2014 21:02:57 +1000 (EST) Received: from localhost ([::1]:37268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOlrU-00046T-24 for incoming@patchwork.ozlabs.org; Tue, 02 Sep 2014 07:02:56 -0400 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 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s82B0atb002823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Sep 2014 11:00:36 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s82B0V2G002683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Sep 2014 11:00:32 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s82B0V4K023382; Tue, 2 Sep 2014 11:00:31 GMT Received: from abi.no.oracle.com (/10.172.144.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Sep 2014 04:00:30 -0700 From: Knut Omang To: qemu-devel@nongnu.org Date: Tue, 2 Sep 2014 13:00:03 +0200 Message-Id: <1409655606-19150-2-git-send-email-knut.omang@oracle.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1409655606-19150-1-git-send-email-knut.omang@oracle.com> References: <1409655606-19150-1-git-send-email-knut.omang@oracle.com> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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 Subject: [Qemu-devel] [PATCH v2 1/4] pci: Make use of the devfn property when registering new devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;