All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Igor Mammedov <imammedo@redhat.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 01/13] pc: Add PCMachineState::pci_host field
Date: Thu, 3 Dec 2015 17:35:03 +0200	[thread overview]
Message-ID: <56606127.1010608@redhat.com> (raw)
In-Reply-To: <1449094978-22986-2-git-send-email-ehabkost@redhat.com>

On 12/03/2015 12:22 AM, Eduardo Habkost wrote:
> This will allow us to avoid direct references to piix and q35 in
> acpi-build.c.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>   hw/i386/pc_q35.c     | 2 ++
>   hw/pci-host/piix.c   | 1 +
>   include/hw/i386/pc.h | 1 +
>   3 files changed, 4 insertions(+)
>
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index 0907746..317d36a 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -171,6 +171,8 @@ static void pc_q35_init(MachineState *machine)
>       phb = PCI_HOST_BRIDGE(q35_host);
>       host_bus = phb->bus;
>       pcms->bus = phb->bus;
> +    pcms->pci_host = phb;
> +
>       /* create ISA bus */
>       lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV,
>                                             ICH9_LPC_FUNC), true,
> diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
> index 715208b..7711e27 100644
> --- a/hw/pci-host/piix.c
> +++ b/hw/pci-host/piix.c
> @@ -335,6 +335,7 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type,
>                       address_space_io, 0, TYPE_PCI_BUS);
>       s->bus = b;
>       object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), NULL);
> +    PC_MACHINE(qdev_get_machine())->pci_host = s;
>       qdev_init_nofail(dev);
>
>       d = pci_create_simple(b, 0, pci_type);
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 6ff4721..8b184c1 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -38,6 +38,7 @@ struct PCMachineState {
>       OnOffAuto vmport;
>       OnOffAuto smm;
>       ram_addr_t below_4g_mem_size, above_4g_mem_size;
> +    PCIHostState *pci_host;

Having both pci_host and bus as class fields is not needed.
If you have the host, maybe you can get rid of the bus.

Thanks,
Marcel

>       PCIBus *bus;
>       Notifier machine_done;
>       FWCfgState *fw_cfg;
>

  reply	other threads:[~2015-12-03 15:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 22:22 [Qemu-devel] [PATCH 00/13] acpi: Make piix-specific and q35-specific code generic Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 01/13] pc: Add PCMachineState::pci_host field Eduardo Habkost
2015-12-03 15:35   ` Marcel Apfelbaum [this message]
2015-12-03 16:35     ` Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 02/13] acpi: Remove unnecessary check for NULL pci_host Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 03/13] acpi: Eliminate acpi_get_i386_pci_host() function Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 04/13] acpi: Move DSDT info to PCMachineClass Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 05/13] acpi: Simplify s3/s4 property querying Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 06/13] acpi: Use &error_abort when getting PCI hotplug properties Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 07/13] acpi: Use QOM property to get CPU hotplug I/O base Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 08/13] acpi: Always try to init PCI " Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 09/13] acpi: Use PCMachineState::acpi_dev to get ACPI dev Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 10/13] acpi: Change acpi_pci_hotplug_enabled() argument to PCMachineState Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 11/13] acpi: Don't use find_i440fx() when setting bsel properties Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 12/13] intel_iommu.h: Missing sysbus.h include Eduardo Habkost
2015-12-02 22:22 ` [Qemu-devel] [PATCH 13/13] acpi: Don't include q35 and piix headers Eduardo Habkost
2015-12-03 15:19 ` [Qemu-devel] [PATCH 00/13] acpi: Make piix-specific and q35-specific code generic Igor Mammedov
2015-12-03 17:16   ` Eduardo Habkost
2015-12-04 13:24     ` Igor Mammedov
2015-12-04 14:08       ` Eduardo Habkost
2015-12-07 15:31         ` Marcel Apfelbaum

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=56606127.1010608@redhat.com \
    --to=marcel@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.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 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.