qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC v3 20/35] pc: Move pci_enabled parameter to PCMachineC


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC v3 20/35] pc: Move pci_enabled parameter to PCMachineClass
Date: Fri, 4 Jul 2014 21:09:47 -0300

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

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 7a6aa66..465efee 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1662,6 +1662,7 @@ static void pc_machine_class_init(ObjectClass *oc, void 
*data)
     HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
 
     pcmc->get_hotplug_handler = mc->get_hotplug_handler;
+    pcmc->pci_enabled = 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 0f229e7..4d5a31c 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -72,10 +72,11 @@ static bool has_reserved_memory = true;
 static bool kvmclock_enabled = true;
 
 /* PC hardware initialisation */
-static void pc_init1(MachineState *machine,
-                     int pci_enabled)
+static void pc_init1(MachineState *machine)
 {
     PCMachineState *pcms = PC_MACHINE(machine);
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
+    bool pci_enabled = pcmc->pci_enabled;
     MemoryRegion *system_memory = get_system_memory();
     MemoryRegion *system_io = get_system_io();
     int i;
@@ -292,7 +293,7 @@ static void pc_init1(MachineState *machine,
 
 static void pc_init_pci(MachineState *machine)
 {
-    pc_init1(machine, 1);
+    pc_init1(machine);
 }
 
 static void pc_compat_2_0(MachineState *machine)
@@ -415,7 +416,7 @@ static void pc_init_isa(MachineState *machine)
     }
     x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
     enable_compat_apic_id_mode();
-    pc_init1(machine, 0);
+    pc_init1(machine);
 }
 
 #ifdef CONFIG_XEN
@@ -960,9 +961,11 @@ static const TypeInfo pc_machine_v0_10_type_info = {
 static void isapc_machine_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
     static GlobalProperty compat_props[] = {
         { /* end of list */ }
     };
+    pcmc->pci_enabled = false;
     mc->desc = "ISA-only PC";
     mc->init = pc_init_isa;
     mc->max_cpus = 1;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 318f2cc..8244db5 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -53,6 +53,7 @@ struct PCMachineClass {
     /*< public >*/
     HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
                                            DeviceState *dev);
+    bool pci_enabled;
 };
 
 typedef struct PCMachineState PCMachineState;
-- 
1.9.3




reply via email to

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