mirror of https://github.com/xemu-project/xemu.git
fw_cfg: allow building without other devices
The microvm machine type uses fw_cfg but lacks SMBIOS and ACPI. Do not include the files if the symbol is not present in QEMU and remove dependencies on machine-specific files. Reviewed-by: Sergio Lopez <slp@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
feab2124a6
commit
b54f33c4e0
|
@ -22,6 +22,9 @@
|
||||||
#include "hw/nvram/fw_cfg.h"
|
#include "hw/nvram/fw_cfg.h"
|
||||||
#include "e820_memory_layout.h"
|
#include "e820_memory_layout.h"
|
||||||
#include "kvm_i386.h"
|
#include "kvm_i386.h"
|
||||||
|
#include "config-devices.h"
|
||||||
|
|
||||||
|
struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
|
||||||
|
|
||||||
const char *fw_cfg_arch_key_name(uint16_t key)
|
const char *fw_cfg_arch_key_name(uint16_t key)
|
||||||
{
|
{
|
||||||
|
@ -46,6 +49,7 @@ const char *fw_cfg_arch_key_name(uint16_t key)
|
||||||
|
|
||||||
void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg)
|
void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_SMBIOS
|
||||||
uint8_t *smbios_tables, *smbios_anchor;
|
uint8_t *smbios_tables, *smbios_anchor;
|
||||||
size_t smbios_tables_len, smbios_anchor_len;
|
size_t smbios_tables_len, smbios_anchor_len;
|
||||||
struct smbios_phys_mem_area *mem_array;
|
struct smbios_phys_mem_area *mem_array;
|
||||||
|
@ -83,6 +87,7 @@ void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg)
|
||||||
fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
|
fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
|
||||||
smbios_anchor, smbios_anchor_len);
|
smbios_anchor, smbios_anchor_len);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
FWCfgState *fw_cfg_arch_create(MachineState *ms,
|
FWCfgState *fw_cfg_arch_create(MachineState *ms,
|
||||||
|
@ -114,8 +119,10 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms,
|
||||||
*/
|
*/
|
||||||
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit);
|
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit);
|
||||||
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
|
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
|
||||||
|
#ifdef CONFIG_ACPI
|
||||||
fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
|
fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
|
||||||
acpi_tables, acpi_tables_len);
|
acpi_tables, acpi_tables_len);
|
||||||
|
#endif
|
||||||
fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override());
|
fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override());
|
||||||
|
|
||||||
fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE,
|
fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE,
|
||||||
|
|
|
@ -101,8 +101,6 @@
|
||||||
#define DPRINTF(fmt, ...)
|
#define DPRINTF(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
|
|
||||||
|
|
||||||
GlobalProperty pc_compat_4_2[] = {};
|
GlobalProperty pc_compat_4_2[] = {};
|
||||||
const size_t pc_compat_4_2_len = G_N_ELEMENTS(pc_compat_4_2);
|
const size_t pc_compat_4_2_len = G_N_ELEMENTS(pc_compat_4_2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue