aboutsummaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2023-06-30 09:37:06 +0200
committerMichael S. Tsirkin <mst@redhat.com>2023-07-10 16:29:17 -0400
commit06a492bd2b75653970e30c3ae0ea79ab1ed4ae31 (patch)
treecab13ab8d4a469ea78043bb3a58b090630b2d91f /hw/i386
parent8cf08065b1b19cea1958a43187755cec6546a5d0 (diff)
hw/pci-host/q35: Initialize PCMachineState::bus in board code
The Q35 PCI host currently sets the PC machine's PCI bus attribute through global state, thereby assuming the machine to be a PC machine. The Q35 machine code already holds on to Q35's pci bus attribute, so can easily set its own property while preserving encapsulation. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230630073720.21297-4-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc_q35.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index d9f3764184..4edc0b35f4 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -230,10 +230,12 @@ static void pc_q35_init(MachineState *machine)
x86ms->below_4g_mem_size, NULL);
object_property_set_int(phb, PCI_HOST_ABOVE_4G_MEM_SIZE,
x86ms->above_4g_mem_size, NULL);
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(phb), &error_fatal);
/* pci */
- sysbus_realize_and_unref(SYS_BUS_DEVICE(phb), &error_fatal);
host_bus = PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0"));
+ pcms->bus = host_bus;
+
/* create ISA bus */
lpc = pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), true,
TYPE_ICH9_LPC_DEVICE);