[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 3/4] hw/pc: query both q35 and i440fx bus
From: |
Marcel Apfelbaum |
Subject: |
Re: [Qemu-devel] [PATCH V2 3/4] hw/pc: query both q35 and i440fx bus |
Date: |
Tue, 17 Nov 2015 12:29:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 11/16/2015 08:26 PM, Eduardo Habkost wrote:
On Sun, Nov 15, 2015 at 05:39:05PM +0200, Marcel Apfelbaum wrote:
Look for pxb devices on both i386 machines.
Signed-off-by: Marcel Apfelbaum <address@hidden>
[...]
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index c81507d..2fbbcd3 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -511,6 +511,14 @@ static void mch_realize(PCIDevice *d, Error **errp)
}
}
+PCIBus *find_q35(void)
+{
+ PCIHostState *s = OBJECT_CHECK(PCIHostState,
+ object_resolve_path("/machine/q35", NULL),
+ TYPE_PCI_HOST_BRIDGE);
Hi Eduardo,
Thanks for the review.
Why not use the PCI_HOST_BRIDGE macro?
Do you mean ?
PCIHostState *s = PCI_HOST_BRIDGE(object_resolve_path("/machine/q35",
NULL));
I can use it, thanks -- I was doing the usual copy/paste of the i440fx
counterpart :)
+ return s ? s->bus : NULL;
+}
+
uint64_t mch_mcfg_base(void)
{
bool ambiguous;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 4bbc0ff..95d7610 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -242,6 +242,15 @@ PCIBus *i440fx_init(const char *host_type, const char
*pci_type,
MemoryRegion *ram_memory);
PCIBus *find_i440fx(void);
+PCIBus *find_q35(void);
+
+static inline PCIBus *find_pc(void)
+{
+ PCIBus *bus = find_i440fx();
+
+ return bus ? bus : find_q35();
Have you considered a /machine/pci link, or (in case you don't
want to add something new to the QOM tree) a simple
PCMachineState::pci_bus struct field?
This is a nice idea, I like the PC machine state, I'll look into it.
Thanks,
Marcel
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, (continued)
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, Marcel Apfelbaum, 2015/11/16
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, Paolo Bonzini, 2015/11/16
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, Laine Stump, 2015/11/19
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, Markus Armbruster, 2015/11/17
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, Marcel Apfelbaum, 2015/11/17
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, Markus Armbruster, 2015/11/17
- Re: [Qemu-devel] [PATCH V2 0/4] hw/pcie: Multi-root support for Q35, Marcel Apfelbaum, 2015/11/17
[Qemu-devel] [PATCH V2 1/4] hw/pxb: remove the built-in pci bridge, Marcel Apfelbaum, 2015/11/16
[Qemu-devel] [PATCH V2 3/4] hw/pc: query both q35 and i440fx bus, Marcel Apfelbaum, 2015/11/16
[Qemu-devel] [PATCH V2 2/4] hw/acpi: merge pxb adjacent memory/IO ranges, Marcel Apfelbaum, 2015/11/16
[Qemu-devel] [PATCH V2 4/4] hw/pxb: add support for PCIe, Marcel Apfelbaum, 2015/11/16