All of lore.kernel.org
 help / color / mirror / Atom feed
From: Knut Omang <knut.omang@oracle.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>, Gabriel Somlo <somlo@cmu.edu>,
	Knut Omang <knut.omang@oracle.com>,
	Alexander Graf <agraf@suse.de>,
	Fabien Chouteau <chouteau@adacore.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Beniamino Galvani <b.galvani@gmail.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>,
	Jan Kiszka <jan.kiszka@web.de>,
	Anthony Liguori <aliguori@amazon.com>,
	Paolo Bonzini <pbonzini@redhat.com>, Amos Kong <akong@redhat.com>
Subject: [Qemu-devel] [PATCH v2 1/4] pci: Make use of the devfn property when registering new devices
Date: Tue,  2 Sep 2014 13:00:03 +0200	[thread overview]
Message-ID: <1409655606-19150-2-git-send-email-knut.omang@oracle.com> (raw)
In-Reply-To: <1409655606-19150-1-git-send-email-knut.omang@oracle.com>

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 <knut.omang@oracle.com>
---
 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

  reply	other threads:[~2014-09-02 11:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 11:00 [Qemu-devel] [PATCH v2 0/4] pcie: Add support for Single Root I/O Virtualization Knut Omang
2014-09-02 11:00 ` Knut Omang [this message]
2014-09-02 13:03   ` [Qemu-devel] [PATCH v2 1/4] pci: Make use of the devfn property when registering new devices Michael S. Tsirkin
2014-09-02 13:44     ` Knut Omang
2014-09-02 13:55       ` Michael S. Tsirkin
2014-10-03 11:59         ` Knut Omang
2014-09-02 11:00 ` [Qemu-devel] [PATCH v2 2/4] pci: Avoid losing config updates to MSI/MSIX cap regs Knut Omang
2014-09-02 12:57   ` Michael S. Tsirkin
2014-09-02 11:00 ` [Qemu-devel] [PATCH v2 3/4] pci: Update pci_regs header Knut Omang
2014-09-02 11:00 ` [Qemu-devel] [PATCH v2 4/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV) Knut Omang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409655606-19150-2-git-send-email-knut.omang@oracle.com \
    --to=knut.omang@oracle.com \
    --cc=agraf@suse.de \
    --cc=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=arei.gonglei@huawei.com \
    --cc=b.galvani@gmail.com \
    --cc=chouteau@adacore.com \
    --cc=jan.kiszka@web.de \
    --cc=lcapitulino@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=somlo@cmu.edu \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.