summaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.a@redhat.com>2015-06-02 14:23:07 +0300
committerMichael S. Tsirkin <mst@redhat.com>2015-06-03 18:19:18 +0200
commit2118196bb3795a43bf708c37bdcf4b3c33778ccb (patch)
tree7b613b9cc5058f243f3f604a1c1fc731455e2b51 /hw/i386
parent40d14bef8012087ade60f254487d31db822a1a44 (diff)
downloadqemu-2118196bb3795a43bf708c37bdcf4b3c33778ccb.zip
hw/pci: inform bios if the system has extra pci root buses
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 <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 1eb1db0372..a93972fb41 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -30,6 +30,7 @@
#include "hw/block/fdc.h"
#include "hw/ide.h"
#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
#include "monitor/monitor.h"
#include "hw/nvram/fw_cfg.h"
#include "hw/timer/hpet.h"
@@ -1119,6 +1120,25 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data)
PcGuestInfoState *guest_info_state = container_of(notifier,
PcGuestInfoState,
machine_done);
+ PCIBus *bus = find_i440fx();
+
+ if (bus) {
+ int extra_hosts = 0;
+
+ QLIST_FOREACH(bus, &bus->child, sibling) {
+ /* look for expander root buses */
+ if (pci_bus_is_root(bus)) {
+ extra_hosts++;
+ }
+ }
+ 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);
}