From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOnkx-0002Ji-Dq for qemu-devel@nongnu.org; Tue, 02 Sep 2014 09:04:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOnkr-0002nW-FH for qemu-devel@nongnu.org; Tue, 02 Sep 2014 09:04:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOnkr-0002nG-82 for qemu-devel@nongnu.org; Tue, 02 Sep 2014 09:04:13 -0400 Date: Tue, 2 Sep 2014 16:03:23 +0300 From: "Michael S. Tsirkin" Message-ID: <20140902130323.GB14127@redhat.com> References: <1409655606-19150-1-git-send-email-knut.omang@oracle.com> <1409655606-19150-2-git-send-email-knut.omang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1409655606-19150-2-git-send-email-knut.omang@oracle.com> Subject: Re: [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: Knut Omang Cc: Peter Maydell , Peter Crosthwaite , Stefan Hajnoczi , Laszlo Ersek , Alexander Graf , qemu-devel@nongnu.org, Fabien Chouteau , Luiz Capitulino , Beniamino Galvani , Alex Williamson , "Gonglei (Arei)" , Jan Kiszka , Anthony Liguori , Paolo Bonzini , Amos Kong , Gabriel Somlo On Tue, Sep 02, 2014 at 01:00:03PM +0200, Knut Omang wrote: > 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 Sorry, I don't understand the explanation exactly. pci_dev->devfn is not set correctly? why? > --- > 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