Received: from eggs.gnu.org ([2001:4830:134:3::10]:35847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3pXg-00053d-Rg for qemu-devel@nongnu.org; Tue, 01 Dec 2015 13:20:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3pXd-0002sJ-K7 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 13:20:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3pXd-0002sF-EQ for qemu-devel@nongnu.org; Tue, 01 Dec 2015 13:20:41 -0500 Date: Tue, 1 Dec 2015 16:20:38 -0200 From: Eduardo Habkost Message-ID: <20151201182038.GD18957@thinpad.lan.raisama.net> References: <1448553628-5446-1-git-send-email-marcel@redhat.com> <1448553628-5446-4-git-send-email-marcel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1448553628-5446-4-git-send-email-marcel@redhat.com> Subject: Re: [Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: mst@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com, laine@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, lersek@redhat.com, rth@twiddle.net On Thu, Nov 26, 2015 at 06:00:28PM +0200, Marcel Apfelbaum wrote: > Add bus property to PC machines and use it when looking > for primary PCI root bus (bus 0). > > Signed-off-by: Marcel Apfelbaum > --- > hw/i386/acpi-build.c | 3 +-- > hw/i386/pc.c | 2 +- > hw/i386/pc_piix.c | 1 + > hw/i386/pc_q35.c | 1 + > include/hw/i386/pc.h | 1 + > 5 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 736b252..bca3f06 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -950,8 +950,7 @@ build_ssdt(GArray *table_data, GArray *linker, > /* Reserve space for header */ > acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader)); > > - /* Extra PCI root buses are implemented only for i440fx */ > - bus = find_i440fx(); > + bus = PC_MACHINE(machine)->bus; You can use acpi_get_i386_pci_host()->bus here, so we can reduce the amount of PC-specific code inside acpi-build.c. (Making acpi_get_i386_pci_host() more generic and not depend on piix- and q35-specific checks is also on my plans) > if (bus) { > QLIST_FOREACH(bus, &bus->child, sibling) { > uint8_t bus_num = pci_bus_num(bus); [...] -- Eduardo