qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH V6 for-2.3 21/26] hw/pci: inform bios if the system


From: Marcel Apfelbaum
Subject: [Qemu-devel] [PATCH V6 for-2.3 21/26] hw/pci: inform bios if the system has extra pci root buses
Date: Thu, 19 Mar 2015 20:52:56 +0200

From: Marcel Apfelbaum <address@hidden>

The bios looks for 'etc/extra-pci-roots' to decide if
is going to scan further buses after bus 0 tree.

Signed-off-by: Marcel Apfelbaum <address@hidden>
---
 hw/i386/pc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 79eaad5..7a8c6dd 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1076,6 +1076,19 @@ void pc_guest_info_machine_done(Notifier *notifier, void 
*data)
     PcGuestInfoState *guest_info_state = container_of(notifier,
                                                       PcGuestInfoState,
                                                       machine_done);
+    PCIHostState *snooped_host = find_i440fx();
+    PCIHostBridgeSnoopedClass *snooped_class =
+        PCI_HOST_BRIDGE_SNOOPED_GET_CLASS(snooped_host);
+    GPtrArray *snooping_hosts = snooped_class->snooping_hosts(snooped_host);
+    int extra_hosts = snooping_hosts->len;
+
+    if (extra_hosts && guest_info_state->info.fw_cfg) {
+        uint64_t *val = g_malloc(sizeof(*val));
+        *val = cpu_to_le64(extra_hosts);
+        fw_cfg_add_file(guest_info_state->info.fw_cfg,
+                        "etc/extra-pci-roots", val, sizeof(*val));
+    }
+
     acpi_setup(&guest_info_state->info);
 }
 
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]