From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PATCH] pcie_host: Turn pcie_host_init() into an instance_init
Date: Wed, 21 May 2014 12:27:10 +0300 [thread overview]
Message-ID: <20140521092710.GB19646@redhat.com> (raw)
In-Reply-To: <1398353211-31873-1-git-send-email-afaerber@suse.de>
On Thu, Apr 24, 2014 at 05:26:51PM +0200, Andreas Färber wrote:
> This assures the trivial field initialization is applied for any derived
> type - currently only Q35PCIHost.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> Michael, I've had this preparation lying around for a while but didn't
> get further yet. Can you take this through the PCI queue already?
Applied, sorry about the delay.
>
> hw/pci-host/q35.c | 4 ----
> hw/pci/pcie_host.c | 7 ++++---
> include/hw/pci/pcie_host.h | 1 -
> 3 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> index 8b8cc4e..aa48b1c 100644
> --- a/hw/pci-host/q35.c
> +++ b/hw/pci-host/q35.c
> @@ -47,10 +47,6 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
> sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
> sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4);
>
> - if (pcie_host_init(PCIE_HOST_BRIDGE(s)) < 0) {
> - error_setg(errp, "failed to initialize pcie host");
> - return;
> - }
> pci->bus = pci_bus_new(DEVICE(s), "pcie.0",
> s->mch.pci_address_space, s->mch.address_space_io,
> 0, TYPE_PCIE_BUS);
> diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c
> index c6e1b57..7c88a1d 100644
> --- a/hw/pci/pcie_host.c
> +++ b/hw/pci/pcie_host.c
> @@ -83,11 +83,11 @@ static const MemoryRegionOps pcie_mmcfg_ops = {
> .endianness = DEVICE_NATIVE_ENDIAN,
> };
>
> -int pcie_host_init(PCIExpressHost *e)
> +static void pcie_host_init(Object *obj)
> {
> - e->base_addr = PCIE_BASE_ADDR_UNMAPPED;
> + PCIExpressHost *e = PCIE_HOST_BRIDGE(obj);
>
> - return 0;
> + e->base_addr = PCIE_BASE_ADDR_UNMAPPED;
> }
>
> void pcie_host_mmcfg_unmap(PCIExpressHost *e)
> @@ -128,6 +128,7 @@ static const TypeInfo pcie_host_type_info = {
> .parent = TYPE_PCI_HOST_BRIDGE,
> .abstract = true,
> .instance_size = sizeof(PCIExpressHost),
> + .instance_init = pcie_host_init,
> };
>
> static void pcie_host_register_types(void)
> diff --git a/include/hw/pci/pcie_host.h b/include/hw/pci/pcie_host.h
> index acca45e..ff44ef6 100644
> --- a/include/hw/pci/pcie_host.h
> +++ b/include/hw/pci/pcie_host.h
> @@ -49,7 +49,6 @@ struct PCIExpressHost {
> MemoryRegion mmio;
> };
>
> -int pcie_host_init(PCIExpressHost *e);
> void pcie_host_mmcfg_unmap(PCIExpressHost *e);
> void pcie_host_mmcfg_map(PCIExpressHost *e, hwaddr addr, uint32_t size);
> void pcie_host_mmcfg_update(PCIExpressHost *e,
> --
> 1.8.4.5
prev parent reply other threads:[~2014-05-21 9:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1398353211-31873-1-git-send-email-afaerber@suse.de>
2014-05-21 9:19 ` [Qemu-devel] [PATCH] pcie_host: Turn pcie_host_init() into an instance_init Andreas Färber
2014-05-21 9:27 ` Michael S. Tsirkin [this message]
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=20140521092710.GB19646@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=qemu-devel@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).