From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvXQ5-0006ZP-VS for qemu-devel@nongnu.org; Fri, 13 Jun 2014 15:45:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvXPz-0006lm-Dz for qemu-devel@nongnu.org; Fri, 13 Jun 2014 15:45:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvXPz-0006lY-2x for qemu-devel@nongnu.org; Fri, 13 Jun 2014 15:45:43 -0400 From: Eduardo Habkost Date: Fri, 13 Jun 2014 16:44:04 -0300 Message-Id: <1402688658-22333-26-git-send-email-ehabkost@redhat.com> In-Reply-To: <1402688658-22333-1-git-send-email-ehabkost@redhat.com> References: <1402688658-22333-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [RFC v2 25/39] pc: Move has_reserved_memory to PCMachineClass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, "Michael S. Tsirkin" Cc: Marcel Apfelbaum , Alexander Graf , Don Slutz , Anthony Liguori , Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c | 6 ++---- hw/i386/pc_q35.c | 6 ++---- include/hw/i386/pc.h | 1 + 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5c6304b..f1fc901 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1620,6 +1620,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->smbios_defaults = true; pcmc->has_acpi_build = true; pcmc->gigabyte_align = true; + pcmc->has_reserved_memory = 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 98812d4..1a82441 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -58,8 +58,6 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 }; static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; -static bool has_reserved_memory = true; - /* PC hardware initialisation */ static void pc_init1(MachineState *machine) { @@ -137,7 +135,7 @@ static void pc_init1(MachineState *machine) guest_info->has_pci_info = pcmc->has_pci_info; guest_info->isapc_ram_fw = !pci_enabled; - guest_info->has_reserved_memory = has_reserved_memory; + guest_info->has_reserved_memory = pcmc->has_reserved_memory; if (pcmc->smbios_defaults) { MachineClass *mc = MACHINE_GET_CLASS(machine); @@ -270,7 +268,6 @@ static void pc_init_pci(MachineState *machine) static void pc_compat_2_0(MachineState *machine) { - has_reserved_memory = false; } static void pc_compat_1_7(MachineState *machine) @@ -435,6 +432,7 @@ static void pc_i440fx_machine_v2_0_class_init(ObjectClass *oc, void *data) mc->name = "pc-i440fx-2.0"; machine_class_add_compat_props(mc, compat_props); pcmc->smbios_legacy_mode = true; + pcmc->has_reserved_memory = false; } static TypeInfo pc_i440fx_machine_v2_0_type_info = { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index ddaeeb5..6bac65a 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -48,8 +48,6 @@ /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 -static bool has_reserved_memory = true; - /* PC hardware initialisation */ static void pc_q35_init(MachineState *machine) { @@ -124,7 +122,7 @@ static void pc_q35_init(MachineState *machine) guest_info->has_pci_info = pcmc->has_pci_info; guest_info->isapc_ram_fw = false; guest_info->has_acpi_build = pcmc->has_acpi_build; - guest_info->has_reserved_memory = has_reserved_memory; + guest_info->has_reserved_memory = pcmc->has_reserved_memory; if (pcmc->smbios_defaults) { MachineClass *mc = MACHINE_GET_CLASS(machine); @@ -248,7 +246,6 @@ static void pc_q35_init(MachineState *machine) static void pc_compat_2_0(MachineState *machine) { - has_reserved_memory = false; } static void pc_compat_1_7(MachineState *machine) @@ -353,6 +350,7 @@ static void pc_q35_machine_v2_0_class_init(ObjectClass *oc, void *data) machine_class_add_compat_props(mc, compat_props); mc->name = "pc-q35-2.0"; pcmc->smbios_legacy_mode = true; + pcmc->has_reserved_memory = false; } static TypeInfo pc_q35_machine_v2_0_type_info = { diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index ee97059..c5d3cbd 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -60,6 +60,7 @@ struct PCMachineClass { * pages in the host. */ bool gigabyte_align; + bool has_reserved_memory; }; typedef struct PCMachineState PCMachineState; -- 1.9.0