From: Marcel Apfelbaum <marcel@redhat.com>
To: Knut Omang <knut.omang@oracle.com>, qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Richard W.M. Jones" <rjones@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
Jan Kiszka <jan.kiszka@web.de>,
Paolo Bonzini <pbonzini@redhat.com>,
Dotan Barak <dotanba@gmail.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v4 1/3] pci: Make use of the devfn property when registering new devices
Date: Thu, 17 Sep 2015 15:41:53 +0300 [thread overview]
Message-ID: <55FAB511.1030901@redhat.com> (raw)
In-Reply-To: <1442491936.2488.135.camel@oracle.com>
On 09/17/2015 03:12 PM, Knut Omang wrote:
> On Thu, 2015-09-17 at 14:11 +0300, Marcel Apfelbaum wrote:
>> On 09/12/2015 03:36 PM, 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 <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 ccea628..a5cc015 100644
>>> --- a/hw/pci/pci.c
>>> +++ b/hw/pci/pci.c
>>> @@ -1840,7 +1840,7 @@ static void pci_qdev_realize(DeviceState
>>> *qdev, Error **errp)
>>> 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, errp);
>>> +
>>> object_property_get_int(OBJECT(qdev), "addr", NULL), errp);
>> Hi,
>>
>> I don't get this, using object_property_get_int on "addr" should
>> return the value of pci_dev->devfn,
>> can you please tell what exactly is not working?
>
> The problem is that at that point pci_dev->devfn has not been set yet -
> have commented on this before somewhere..
>
But "addr" property has the right value? Is indeed strange because it should
get the value from pci_dev->devfn.
Don't get me wrong, this patch is OK.
I just want to understand if we have a hidden bug somewhere.
Anyway,
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
> Knut
>
>> Thanks,
>> Marcel
>>
>>
>>
>>> if (pci_dev == NULL)
>>> return;
>>>
>>>
>>
next prev parent reply other threads:[~2015-09-17 12:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-12 12:36 [Qemu-devel] [PATCH v4 0/3] pcie: Add support for Single Root I/O Virtualization Knut Omang
2015-09-12 12:36 ` [Qemu-devel] [PATCH v4 1/3] pci: Make use of the devfn property when registering new devices Knut Omang
2015-09-17 11:11 ` Marcel Apfelbaum
2015-09-17 12:12 ` Knut Omang
2015-09-17 12:41 ` Marcel Apfelbaum [this message]
2015-10-14 10:27 ` Knut Omang
2015-09-12 12:36 ` [Qemu-devel] [PATCH v4 2/3] pci: Update pci_regs header Knut Omang
2015-10-07 13:32 ` Marcel Apfelbaum
2015-10-10 10:46 ` Knut Omang
2015-09-12 12:36 ` [Qemu-devel] [PATCH v4 3/3] pcie: Add support for Single Root I/O Virtualization (SR/IOV) Knut Omang
2015-09-17 11:49 ` Marcel Apfelbaum
2015-09-17 14:10 ` Knut Omang
2015-10-07 13:45 ` Marcel Apfelbaum
2015-10-14 12:25 ` Knut Omang
2015-10-07 15:06 ` Marcel Apfelbaum
2015-10-11 13:56 ` 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=55FAB511.1030901@redhat.com \
--to=marcel@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=dotanba@gmail.com \
--cc=ehabkost@redhat.com \
--cc=jan.kiszka@web.de \
--cc=knut.omang@oracle.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=rth@twiddle.net \
/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.