All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"David Gibson" <dgibson@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Laszlo Ersek" <lersek@redhat.com>,
	"Marcel Apfelbaum" <marcel@redhat.com>,
	"Alexander Graf" <agraf@suse.de>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Cornelia Huck" <cornelia.huck@de.ibm.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Paul Burton" <paul.burton@imgtec.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Scott Wood" <scottwood@freescale.com>,
	"Yongbok Kim" <yongbok.kim@imgtec.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>
Subject: Re: [Qemu-devel] [RFC v2 3/6] pci: Rename and change signatures of pci_bus_new() & related functions
Date: Wed, 19 Apr 2017 09:50:01 -0300	[thread overview]
Message-ID: <20170419125001.GU25239@thinpad.lan.raisama.net> (raw)
In-Reply-To: <CAFEAcA_Ky5SecogNFq3+RO8pX4sqxvsSbw0KihAv=8teqCSJbw@mail.gmail.com>

On Wed, Apr 19, 2017 at 09:41:42AM +0100, Peter Maydell wrote:
> On 18 April 2017 at 23:17, Eduardo Habkost <ehabkost@redhat.com> wrote:
> > pci_bus_new*() and pci_register_bus() work only when the 'parent'
> > argument is a PCI_HOST_BRIDGE object. Rename them to reflect that they
> > are meant to initialize a bus that's in a PCI host bridge.
> >
> > The new function names are:
> > * pci_host_bus_init() (replacing pci_bus_new())
> > * pci_host_bus_init_inplace() (replacing pci_bus_new_inplace())
> > * pci_host_bus_init_irqs() (replacing pci_register_bus())
> 
> This is moving these functions away from the convention that
> we seem to mostly follow for buses (eg ISA, SCSI) of
> foo_bus_new() to allocate and return a new bus, and
> foo_bus_new_inplace() to initialize a bus that's inline in
> some other struct.
> 
> I'm not sure this is a good idea unless we have a plan to
> convert all the other QOM buses and document that this is
> the right way to implement init for a bus.

The point of the rename is that those functions are doing more
than just allocating a PCIBus. They do some initialization of
PCIHostState as well. That's why non-root PCI buses can't be
created by pci_bus_new*() today.

Maybe the answer here is to move the PCI_HOST_BRIDGE-specific
code somewhere else, and make pci_bus_new*() more generic. This
would allow us to reuse pci_bus_new*() when creating non-root PCI
buses, later.

-- 
Eduardo

  reply	other threads:[~2017-04-19 12:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 22:17 [Qemu-devel] [RFC v2 0/6] pci: Refactor PCI root bus creation code Eduardo Habkost
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 1/6] pci: Inline pci_host_bus_register() inside pci_bus_init() Eduardo Habkost
2017-04-19  0:22   ` David Gibson
2017-04-19 18:09   ` Marcel Apfelbaum
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 2/6] pci: Move pci_bus_init() logic to pci_bus_new_inplace() Eduardo Habkost
2017-04-19  0:23   ` David Gibson
2017-04-19 18:31   ` Marcel Apfelbaum
2017-04-25 19:24     ` Eduardo Habkost
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 3/6] pci: Rename and change signatures of pci_bus_new() & related functions Eduardo Habkost
2017-04-19  0:29   ` David Gibson
2017-04-19  1:42     ` Eduardo Habkost
2017-04-19 12:05       ` Cornelia Huck
2017-04-19 18:41         ` Marcel Apfelbaum
2017-04-19 21:19           ` Eduardo Habkost
2017-04-19  8:41   ` Peter Maydell
2017-04-19 12:50     ` Eduardo Habkost [this message]
2017-04-20  5:04       ` David Gibson
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 4/6] pci: Manually simplify QOM casts at pci_host_bus_init*() calls Eduardo Habkost
2017-04-19  0:30   ` David Gibson
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 5/6] pci: Set phb->bus inside pci_host_bus_init_inplace() Eduardo Habkost
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 6/6] pci: Remove unnecessary PCIBus variables Eduardo Habkost
2017-04-19 12:20   ` Cornelia Huck

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=20170419125001.GU25239@thinpad.lan.raisama.net \
    --to=ehabkost@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=aurelien@aurel32.net \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dgibson@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=lersek@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=paul.burton@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=scottwood@freescale.com \
    --cc=yongbok.kim@imgtec.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.