pc: Use PCMachineState for pc_memory_init() argument
authorEduardo Habkost <ehabkost@redhat.com>
Fri, 7 Aug 2015 19:55:50 +0000 (16:55 -0300)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 13 Aug 2015 11:08:27 +0000 (14:08 +0300)
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 <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/pc.c
hw/i386/pc_piix.c
hw/i386/pc_q35.c
include/hw/i386/pc.h

index 255476b18e94eee9394127229246aa254183f74b..a9a9cf48238f52715ea937da53f4d90ecb38a86b 100644 (file)
@@ -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);
 
index b975c21cfed3f4f9e8c3cf2261520b22177c979b..18e9aa5129a56e695a48fdcf3c10d50195259082 100644 (file)
@@ -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) {
index 441e9d9b727108b756180871ba5a551d1e571f58..6763f0de2f9ad793eeadaf0af8527963613101a2 100644 (file)
@@ -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);
     }
index d8184cd20611ba775def34746d21673999cd8823..4fa2b3fb223565454db0797e4b8164428378e7f5 100644 (file)
@@ -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,