qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v2 22/39] pc: Move has_acpi_build to PCMachineClass


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC v2 22/39] pc: Move has_acpi_build to PCMachineClass
Date: Fri, 13 Jun 2014 16:44:01 -0300

Signed-off-by: Eduardo Habkost <address@hidden>
---
 hw/i386/pc.c         |  1 +
 hw/i386/pc_piix.c    | 10 +++++-----
 hw/i386/pc_q35.c     |  6 +++---
 include/hw/i386/pc.h |  1 +
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 820532a..874c342 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1618,6 +1618,7 @@ static void pc_machine_class_init(ObjectClass *oc, void 
*data)
     pcmc->get_hotplug_handler = mc->get_hotplug_handler;
     pcmc->kvmclock_enabled = true;
     pcmc->smbios_defaults = true;
+    pcmc->has_acpi_build = true;
     mc->get_hotplug_handler = pc_get_hotpug_handler;
     mc->default_boot_order = "cad";
     mc->hot_add_cpu = pc_hot_add_cpu;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index b521121..89e4ca9 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -59,7 +59,6 @@ static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
 static bool has_pci_info;
-static bool has_acpi_build = 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.
@@ -140,7 +139,7 @@ static void pc_init1(MachineState *machine)
 
     guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size);
 
-    guest_info->has_acpi_build = has_acpi_build;
+    guest_info->has_acpi_build = pcmc->has_acpi_build;
 
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = !pci_enabled;
@@ -293,7 +292,6 @@ static void pc_compat_1_6(MachineState *machine)
     pc_compat_1_7(machine);
     has_pci_info = false;
     rom_file_has_mr = false;
-    has_acpi_build = false;
 }
 
 static void pc_compat_1_5(MachineState *machine)
@@ -368,7 +366,6 @@ static void pc_init_pci_1_2(MachineState *machine)
 static void pc_init_pci_no_kvmclock(MachineState *machine)
 {
     has_pci_info = false;
-    has_acpi_build = false;
     x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
     enable_compat_apic_id_mode();
     pc_init1(machine);
@@ -377,7 +374,6 @@ static void pc_init_pci_no_kvmclock(MachineState *machine)
 static void pc_init_isa(MachineState *machine)
 {
     has_pci_info = false;
-    has_acpi_build = false;
     if (!machine->cpu_model) {
         machine->cpu_model = "486";
     }
@@ -482,6 +478,7 @@ static TypeInfo pc_i440fx_machine_v1_7_type_info = {
 static void pc_i440fx_machine_v1_6_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
     static GlobalProperty compat_props[] = {
         PC_COMPAT_1_6,
         { /* end of list */ }
@@ -490,6 +487,7 @@ static void pc_i440fx_machine_v1_6_class_init(ObjectClass 
*oc, void *data)
     mc->init = pc_init_pci_1_6;
     mc->name = "pc-i440fx-1.6";
     machine_class_add_compat_props(mc, compat_props);
+    pcmc->has_acpi_build = false;
 }
 
 static TypeInfo pc_i440fx_machine_v1_6_type_info = {
@@ -806,6 +804,7 @@ static void pc_machine_v0_13_class_init(ObjectClass *oc, 
void *data)
     mc->name = "pc-0.13";
     machine_class_add_compat_props(mc, compat_props);
     pcmc->kvmclock_enabled = false;
+    pcmc->has_acpi_build = false;
 }
 
 static TypeInfo pc_machine_v0_13_type_info = {
@@ -948,6 +947,7 @@ static void isapc_machine_class_init(ObjectClass *oc, void 
*data)
     mc->name = "isapc";
     machine_class_add_compat_props(mc, compat_props);
     pcmc->smbios_defaults = false;
+    pcmc->has_acpi_build = false;
 }
 
 static TypeInfo isapc_machine_type_info = {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 7f991e4..129b0bb 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -49,7 +49,6 @@
 #define MAX_SATA_PORTS     6
 
 static bool has_pci_info;
-static bool has_acpi_build = 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.
@@ -130,7 +129,7 @@ static void pc_q35_init(MachineState *machine)
     guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size);
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = false;
-    guest_info->has_acpi_build = has_acpi_build;
+    guest_info->has_acpi_build = pcmc->has_acpi_build;
     guest_info->has_reserved_memory = has_reserved_memory;
 
     if (pcmc->smbios_defaults) {
@@ -271,7 +270,6 @@ static void pc_compat_1_6(MachineState *machine)
     pc_compat_1_7(machine);
     has_pci_info = false;
     rom_file_has_mr = false;
-    has_acpi_build = false;
 }
 
 static void pc_compat_1_5(MachineState *machine)
@@ -396,6 +394,7 @@ static TypeInfo pc_q35_machine_v1_7_type_info = {
 static void pc_q35_machine_v1_6_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
     static GlobalProperty compat_props[] = {
         PC_Q35_COMPAT_1_6,
         { /* end of list */ }
@@ -404,6 +403,7 @@ static void pc_q35_machine_v1_6_class_init(ObjectClass *oc, 
void *data)
     mc->init = pc_q35_init_1_6;
     machine_class_add_compat_props(mc, compat_props);
     mc->name = "pc-q35-1.6";
+    pcmc->has_acpi_build = false;
 }
 
 static TypeInfo pc_q35_machine_v1_6_type_info = {
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 2c38cdd..84ba9af 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -53,6 +53,7 @@ struct PCMachineClass {
     bool kvmclock_enabled;
     bool smbios_legacy_mode;
     bool smbios_defaults;
+    bool has_acpi_build;
 };
 
 typedef struct PCMachineState PCMachineState;
-- 
1.9.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]