[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/24] pc: Use PCMachineState for pc_memory_init() ar
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 12/24] pc: Use PCMachineState for pc_memory_init() argument |
Date: |
Thu, 13 Aug 2015 15:15:14 +0300 |
From: Eduardo Habkost <address@hidden>
pc_memory_init() already expects a PCMachineState object, there's no
point in upcasting it to MachineState before calling the function.
Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i386/pc.h | 2 +-
hw/i386/pc.c | 4 ++--
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index d8184cd..4fa2b3f 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -185,7 +185,7 @@ FWCfgState *xen_load_linux(const char *kernel_filename,
const char *initrd_filename,
ram_addr_t below_4g_mem_size,
PcGuestInfo *guest_info);
-FWCfgState *pc_memory_init(MachineState *machine,
+FWCfgState *pc_memory_init(PCMachineState *pcms,
MemoryRegion *system_memory,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 255476b..a9a9cf4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1289,7 +1289,7 @@ FWCfgState *xen_load_linux(const char *kernel_filename,
return fw_cfg;
}
-FWCfgState *pc_memory_init(MachineState *machine,
+FWCfgState *pc_memory_init(PCMachineState *pcms,
MemoryRegion *system_memory,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
@@ -1301,7 +1301,7 @@ FWCfgState *pc_memory_init(MachineState *machine,
MemoryRegion *ram, *option_rom_mr;
MemoryRegion *ram_below_4g, *ram_above_4g;
FWCfgState *fw_cfg;
- PCMachineState *pcms = PC_MACHINE(machine);
+ MachineState *machine = MACHINE(pcms);
assert(machine->ram_size == below_4g_mem_size + above_4g_mem_size);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index b975c21..18e9aa5 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -178,7 +178,7 @@ static void pc_init1(MachineState *machine)
/* allocate ram and load rom/bios */
if (!xen_enabled()) {
- pc_memory_init(machine, system_memory,
+ pc_memory_init(pcms, system_memory,
below_4g_mem_size, above_4g_mem_size,
rom_memory, &ram_memory, guest_info);
} else if (machine->kernel_filename != NULL) {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 441e9d9..6763f0d 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -170,7 +170,7 @@ static void pc_q35_init(MachineState *machine)
/* allocate ram and load rom/bios */
if (!xen_enabled()) {
- pc_memory_init(machine, get_system_memory(),
+ pc_memory_init(pcms, get_system_memory(),
below_4g_mem_size, above_4g_mem_size,
rom_memory, &ram_memory, guest_info);
}
--
MST
- [Qemu-devel] [PULL 01/24] make: fix where dependency *.d are stored., (continued)
- [Qemu-devel] [PULL 01/24] make: fix where dependency *.d are stored., Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 02/24] make: load only required dependency files., Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 03/24] piix: Document coreboot-specific RAM size config register, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 04/24] pc: Use PC_COMPAT_* for CPUID feature compatibility, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 05/24] target-i386: Remove x86_cpu_compat_set_features(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 06/24] pc: Use error_abort when registering properties, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 07/24] pc: Rename pc_machine variables to pcms, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 09/24] pc: Eliminate pc_common_machine_options(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 08/24] pc: Move PCMachineClass, PCMachineState to qemu/typedefs.h, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 10/24] pc: Eliminate pc_default_machine_options(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 12/24] pc: Use PCMachineState for pc_memory_init() argument,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 11/24] pc: Use PCMachineState for pc_cmos_init() argument, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 14/24] pc: Use PCMachineState as pc_guest_info_init() argument, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 13/24] pc: Move {above, below}_4g_mem_size variables to PCMachineState, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 15/24] pc: Remove redundant arguments from *load_linux(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 17/24] pc: Remove redundant arguments from pc_memory_init(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 16/24] pc: Remove redundant arguments from pc_cmos_init(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 18/24] pci: allow 0 address for PCI IO/MEM regions, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 19/24] virtio-net: remove useless codes, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 20/24] acpi: avoid potential uninitialized access to cpu_hp_io_base, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 21/24] smbios: extract x86 smbios building code into a function, Michael S. Tsirkin, 2015/08/13