From: "Andreas Färber" <afaerber@suse.de>
To: Alexander Graf <agraf@suse.de>
Cc: "qemu-devel@nongnu.org qemu-devel" <qemu-devel@nongnu.org>,
"qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>,
Avi Kivity <avi@redhat.com>,
Bhushan Bharat-R65777 <R65777@freescale.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller
Date: Mon, 08 Oct 2012 15:57:49 +0200 [thread overview]
Message-ID: <5072DBDD.7020600@suse.de> (raw)
In-Reply-To: <E846491D-738E-48E2-BA54-7D0824A4599E@suse.de>
Am 08.10.2012 10:50, schrieb Alexander Graf:
>
> On 08.10.2012, at 10:23, Bhushan Bharat-R65777 wrote:
>>>> @@ -307,6 +313,16 @@ static const VMStateDescription
>>>> vmstate_ppce500_pci = {
>>>>
>>>> #include "exec-memory.h"
>>>>
>>>> +static int e500_pcihost_bridge_initfn(PCIDevice *d) {
>>>> + bharat *b = DO_UPCAST(bharat, p, d);
>>>> +
>>>> + printf("Addr = %llx, size = %llx\n", ((MemoryRegion *)b->bar0)->addr,
>>> (unsigned long long)int128_get64(((Me
>>>> + pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY,
>>>> + (MemoryRegion *)b->bar0);
>>>
>>> That one still has to call its parent initfn, no?
>>
>> I am really sorry, but I did not get. The object says its parent is TYPE_PCI_DEVICE, so which function are you talking about?
>
> In object oriented programming, every time you overload a class, your constructor should call the overloaded class's constructor. I don't see this happening for other PCI device's init functions though.
>
> Andreas, shouldn't parent class init be called for pci subclass devices?
.class_init and .instance_init are called iteratively through the
hierarchy, so no parent method needs to be called manually. This is
different for user-coded methods like CPUState::reset. qdev initfns
haven't changed in that respect to date - they are orthogonal to QOM.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-10-08 13:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 11:49 [Qemu-devel] [PATCH 0/2] e500: creating CCSR region and registering bar0 Bharat Bhushan
2012-10-03 11:49 ` [Qemu-devel] [PATCH 1/2] e500: Adding CCSR memory region Bharat Bhushan
2012-10-03 12:08 ` Alexander Graf
2012-10-03 12:16 ` Bhushan Bharat-R65777
2012-10-03 12:18 ` Alexander Graf
2012-10-03 11:50 ` [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller Bharat Bhushan
2012-10-03 12:11 ` Alexander Graf
2012-10-03 12:23 ` Bhushan Bharat-R65777
2012-10-04 12:31 ` Avi Kivity
2012-10-04 13:46 ` Bhushan Bharat-R65777
2012-10-04 14:58 ` Avi Kivity
2012-10-04 16:03 ` Bhushan Bharat-R65777
2012-10-04 16:07 ` Alexander Graf
2012-10-04 16:48 ` Bhushan Bharat-R65777
2012-10-04 16:50 ` Alexander Graf
2012-10-04 17:02 ` Avi Kivity
2012-10-05 7:11 ` Bhushan Bharat-R65777
2012-10-05 11:59 ` Alexander Graf
2012-10-07 9:48 ` Avi Kivity
2012-10-07 11:57 ` Alexander Graf
2012-10-07 12:41 ` Avi Kivity
2012-10-08 8:23 ` Bhushan Bharat-R65777
2012-10-08 8:50 ` Alexander Graf
2012-10-08 13:57 ` Andreas Färber [this message]
2012-10-04 15:54 ` Andreas Färber
2012-10-04 16:01 ` Alexander Graf
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=5072DBDD.7020600@suse.de \
--to=afaerber@suse.de \
--cc=R65777@freescale.com \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).