[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 20/39] pc: Move smbios_legacy_mode to PCMachineClas
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [RFC v2 20/39] pc: Move smbios_legacy_mode to PCMachineClass |
Date: |
Fri, 13 Jun 2014 16:43:59 -0300 |
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/i386/pc_piix.c | 7 ++++---
hw/i386/pc_q35.c | 7 ++++---
include/hw/i386/pc.h | 1 +
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index a1f285d..422656e 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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;
-static bool smbios_legacy_mode;
/* 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.
@@ -150,9 +149,10 @@ static void pc_init1(MachineState *machine)
if (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, smbios_legacy_mode);
+ mc->name, pcmc->smbios_legacy_mode);
}
/* allocate ram and load rom/bios */
@@ -279,7 +279,6 @@ static void pc_init_pci(MachineState *machine)
static void pc_compat_2_0(MachineState *machine)
{
- smbios_legacy_mode = true;
has_reserved_memory = false;
}
@@ -443,6 +442,7 @@ static TypeInfo pc_i440fx_machine_v2_1_type_info = {
static void pc_i440fx_machine_v2_0_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
static GlobalProperty compat_props[] = {
PC_COMPAT_2_0,
{ /* end of list */ }
@@ -453,6 +453,7 @@ static void pc_i440fx_machine_v2_0_class_init(ObjectClass
*oc, void *data)
mc->init = pc_init_pci_2_0;
mc->name = "pc-i440fx-2.0";
machine_class_add_compat_props(mc, compat_props);
+ pcmc->smbios_legacy_mode = true;
}
static TypeInfo pc_i440fx_machine_v2_0_type_info = {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 8c0fe64..65e4cc4 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -51,7 +51,6 @@
static bool has_pci_info;
static bool has_acpi_build = true;
static bool smbios_defaults = true;
-static bool smbios_legacy_mode;
/* 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.
@@ -137,9 +136,10 @@ static void pc_q35_init(MachineState *machine)
if (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, smbios_legacy_mode);
+ mc->name, pcmc->smbios_legacy_mode);
}
/* allocate ram and load rom/bios */
@@ -257,7 +257,6 @@ static void pc_q35_init(MachineState *machine)
static void pc_compat_2_0(MachineState *machine)
{
- smbios_legacy_mode = true;
has_reserved_memory = false;
}
@@ -356,6 +355,7 @@ static TypeInfo pc_q35_machine_v2_1_type_info = {
static void pc_q35_machine_v2_0_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
static GlobalProperty compat_props[] = {
PC_Q35_COMPAT_2_0,
{ /* end of list */ }
@@ -365,6 +365,7 @@ static void pc_q35_machine_v2_0_class_init(ObjectClass *oc,
void *data)
mc->init = pc_q35_init_2_0;
machine_class_add_compat_props(mc, compat_props);
mc->name = "pc-q35-2.0";
+ pcmc->smbios_legacy_mode = true;
}
static TypeInfo pc_q35_machine_v2_0_type_info = {
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 4715b72..b767b79 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -51,6 +51,7 @@ struct PCMachineClass {
DeviceState *dev);
bool pci_enabled;
bool kvmclock_enabled;
+ bool smbios_legacy_mode;
};
typedef struct PCMachineState PCMachineState;
--
1.9.0
- [Qemu-devel] [RFC v2 30/39] pc: Eliminate empty or trivial compat functions, (continued)
- [Qemu-devel] [RFC v2 30/39] pc: Eliminate empty or trivial compat functions, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 31/39] piix: Move compat/init functions closer to corresponding class_init, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 32/39] pc: Rename pc_machine variable to pcms, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 34/39] pc: Move duplicate Xen init code to pc_machine_init(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 35/39] pc: Move icc_bridge variable to PCMachineState, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 36/39] pc: Move duplicate icc-bridge and CPU initalization to pc_machine_init(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 37/39] pc: Make pc_cpus_init() static, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 38/39] pc: Make pc_cpus_init() use PCMachineState, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 39/39] machine: Eliminate QEMUMachine.compat_props, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 19/39] pc: Move kvmclock_enabled to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 20/39] pc: Move smbios_legacy_mode to PCMachineClass,
Eduardo Habkost <=
- [Qemu-devel] [RFC v2 17/39] pc: Move pci_enabled parameter to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 18/39] q35: Use PCMachineClass.pci_enabled field, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 33/39] pc: Move {ram, pci, rom}_memory variables to PCMachineState, Eduardo Habkost, 2014/06/13
- Re: [Qemu-devel] [RFC v2 00/39] Convert PC machine-types to QOM classes, Eduardo Habkost, 2014/06/13