@@ -1664,6 +1664,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pcmc->get_hotplug_handler = mc->get_hotplug_handler;
pcmc->pci_enabled = true;
pcmc->kvmclock_enabled = true;
+ pcmc->smbios_defaults = true;
mc->get_hotplug_handler = pc_get_hotpug_handler;
mc->default_boot_order = "cad";
mc->hot_add_cpu = pc_hot_add_cpu;
@@ -61,7 +61,6 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
static bool has_pci_info;
static bool has_acpi_build = true;
-static bool smbios_defaults = true;
/* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
* host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte
* pages in the host.
@@ -167,9 +166,8 @@ static void pc_init1(MachineState *machine)
guest_info->isapc_ram_fw = !pci_enabled;
guest_info->has_reserved_memory = has_reserved_memory;
- if (smbios_defaults) {
+ if (pcmc->smbios_defaults) {
MachineClass *mc = MACHINE_GET_CLASS(machine);
- PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(mc);
/* These values are guest ABI, do not change */
smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
mc->name, pcmc->smbios_legacy_mode);
@@ -303,7 +301,6 @@ static void pc_compat_2_0(MachineState *machine)
static void pc_compat_1_7(MachineState *machine)
{
pc_compat_2_0(machine);
- smbios_defaults = false;
gigabyte_align = false;
option_rom_has_mr = true;
x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
@@ -402,7 +399,6 @@ static void pc_init_isa(MachineState *machine)
{
has_pci_info = false;
has_acpi_build = false;
- smbios_defaults = false;
gigabyte_align = false;
has_reserved_memory = false;
option_rom_has_mr = true;
@@ -487,6 +483,7 @@ static const TypeInfo pc_i440fx_machine_v2_0_type_info = {
static void pc_i440fx_machine_v1_7_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
static GlobalProperty compat_props[] = {
PC_COMPAT_1_7,
{ /* end of list */ }
@@ -496,6 +493,7 @@ static void pc_i440fx_machine_v1_7_class_init(ObjectClass *oc, void *data)
mc->init = pc_init_pci_1_7;
mc->name = "pc-i440fx-1.7";
machine_class_add_compat_props(mc, compat_props);
+ pcmc->smbios_defaults = false;
}
static const TypeInfo pc_i440fx_machine_v1_7_type_info = {
@@ -973,6 +971,7 @@ static void isapc_machine_class_init(ObjectClass *oc, void *data)
mc->hot_add_cpu = NULL;
mc->name = "isapc";
machine_class_add_compat_props(mc, compat_props);
+ pcmc->smbios_defaults = false;
}
static const TypeInfo isapc_machine_type_info = {
@@ -51,7 +51,6 @@
static bool has_pci_info;
static bool has_acpi_build = true;
-static bool smbios_defaults = true;
/* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
* host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte
* pages in the host.
@@ -155,9 +154,8 @@ static void pc_q35_init(MachineState *machine)
guest_info->has_acpi_build = has_acpi_build;
guest_info->has_reserved_memory = has_reserved_memory;
- if (smbios_defaults) {
+ if (pcmc->smbios_defaults) {
MachineClass *mc = MACHINE_GET_CLASS(machine);
- PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
/* These values are guest ABI, do not change */
smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
mc->name, pcmc->smbios_legacy_mode);
@@ -282,7 +280,6 @@ static void pc_compat_2_0(MachineState *machine)
static void pc_compat_1_7(MachineState *machine)
{
pc_compat_2_0(machine);
- smbios_defaults = false;
gigabyte_align = false;
option_rom_has_mr = true;
x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
@@ -396,6 +393,7 @@ static TypeInfo pc_q35_machine_v2_0_type_info = {
static void pc_q35_machine_v1_7_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
static GlobalProperty compat_props[] = {
PC_COMPAT_1_7,
{ /* end of list */ }
@@ -405,6 +403,7 @@ static void pc_q35_machine_v1_7_class_init(ObjectClass *oc, void *data)
mc->init = pc_q35_init_1_7;
machine_class_add_compat_props(mc, compat_props);
mc->name = "pc-q35-1.7";
+ pcmc->smbios_defaults = false;
}
static TypeInfo pc_q35_machine_v1_7_type_info = {
@@ -56,6 +56,7 @@ struct PCMachineClass {
bool pci_enabled;
bool kvmclock_enabled;
bool smbios_legacy_mode;
+ bool smbios_defaults;
};
typedef struct PCMachineState PCMachineState;
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c | 9 ++++----- hw/i386/pc_q35.c | 7 +++---- include/hw/i386/pc.h | 1 + 4 files changed, 9 insertions(+), 9 deletions(-)