aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2015-12-11 16:42:31 -0200
committerMichael S. Tsirkin <mst@redhat.com>2016-02-06 20:44:09 +0200
commitf264d360e0bebf4fae054e624bf7204788aff99d (patch)
tree28217ac3c2f17ddba7e8ab9468ae9f23e9b0846d
parent5db3f0deaf165bd0ff247fcea042cb2e60671e43 (diff)
pc: Move PcGuestInfo.fw_cfg to PCMachineState
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
-rw-r--r--hw/i386/acpi-build.c7
-rw-r--r--hw/i386/pc.c10
-rw-r--r--include/hw/i386/pc.h2
3 files changed, 8 insertions, 11 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index dac7137471..86baf63a1d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2806,11 +2806,10 @@ void acpi_setup(void)
{
PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
- PcGuestInfo *guest_info = &pcms->acpi_guest_info;
AcpiBuildTables tables;
AcpiBuildState *build_state;
- if (!guest_info->fw_cfg) {
+ if (!pcms->fw_cfg) {
ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
return;
}
@@ -2841,7 +2840,7 @@ void acpi_setup(void)
build_state->linker_mr =
acpi_add_rom_blob(build_state, tables.linker, "etc/table-loader", 0);
- fw_cfg_add_file(guest_info->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
+ fw_cfg_add_file(pcms->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
tables.tcpalog->data, acpi_data_len(tables.tcpalog));
if (!pcmc->rsdp_in_ram) {
@@ -2853,7 +2852,7 @@ void acpi_setup(void)
uint32_t rsdp_size = acpi_data_len(tables.rsdp);
build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size);
- fw_cfg_add_file_callback(guest_info->fw_cfg, ACPI_BUILD_RSDP_FILE,
+ fw_cfg_add_file_callback(pcms->fw_cfg, ACPI_BUILD_RSDP_FILE,
acpi_build_update, build_state,
build_state->rsdp, rsdp_size);
build_state->rsdp_mr = NULL;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index dc0ade4a8c..a47784a38e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1172,10 +1172,10 @@ void pc_machine_done(Notifier *notifier, void *data)
extra_hosts++;
}
}
- if (extra_hosts && pcms->acpi_guest_info.fw_cfg) {
+ if (extra_hosts && pcms->fw_cfg) {
uint64_t *val = g_malloc(sizeof(*val));
*val = cpu_to_le64(extra_hosts);
- fw_cfg_add_file(pcms->acpi_guest_info.fw_cfg,
+ fw_cfg_add_file(pcms->fw_cfg,
"etc/extra-pci-roots", val, sizeof(*val));
}
}
@@ -1257,7 +1257,6 @@ void xen_load_linux(PCMachineState *pcms)
{
int i;
FWCfgState *fw_cfg;
- PcGuestInfo *guest_info = &pcms->acpi_guest_info;
assert(MACHINE(pcms)->kernel_filename != NULL);
@@ -1270,7 +1269,7 @@ void xen_load_linux(PCMachineState *pcms)
!strcmp(option_rom[i].name, "multiboot.bin"));
rom_add_option(option_rom[i].name, option_rom[i].bootindex);
}
- guest_info->fw_cfg = fw_cfg;
+ pcms->fw_cfg = fw_cfg;
}
void pc_memory_init(PCMachineState *pcms,
@@ -1278,7 +1277,6 @@ void pc_memory_init(PCMachineState *pcms,
MemoryRegion *rom_memory,
MemoryRegion **ram_memory)
{
- PcGuestInfo *guest_info = &pcms->acpi_guest_info;
int linux_boot, i;
MemoryRegion *ram, *option_rom_mr;
MemoryRegion *ram_below_4g, *ram_above_4g;
@@ -1399,7 +1397,7 @@ void pc_memory_init(PCMachineState *pcms,
for (i = 0; i < nb_option_roms; i++) {
rom_add_option(option_rom[i].name, option_rom[i].bootindex);
}
- guest_info->fw_cfg = fw_cfg;
+ pcms->fw_cfg = fw_cfg;
}
qemu_irq pc_allocate_cpu_irq(void)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 6a5c4da053..40249b6b02 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -40,7 +40,6 @@ struct PcGuestInfo {
uint64_t numa_nodes;
uint64_t *node_mem;
uint64_t *node_cpu;
- FWCfgState *fw_cfg;
};
/**
@@ -62,6 +61,7 @@ struct PCMachineState {
HotplugHandler *acpi_dev;
ISADevice *rtc;
PCIBus *bus;
+ FWCfgState *fw_cfg;
/* Configuration options: */
uint64_t max_ram_below_4g;