@@ -1073,9 +1073,22 @@ typedef struct PcGuestInfoState {
static
void pc_guest_info_machine_done(Notifier *notifier, void *data)
{
+ PCIHostState *host;
+ int hosts = 0;
PcGuestInfoState *guest_info_state = container_of(notifier,
PcGuestInfoState,
machine_done);
+ HOST_BRIDGE_FOREACH(host) {
+ hosts++;
+ }
+
+ if (hosts && guest_info_state->info.fw_cfg) {
+ uint64_t *val = g_malloc(sizeof(*val));
+ *val = cpu_to_le64(hosts - 1);
+ fw_cfg_add_file(guest_info_state->info.fw_cfg,
+ "etc/extra-pci-roots", val, sizeof(*val));
+ }
+
acpi_setup(&guest_info_state->info);
}