]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hppa: drop usage of memory_region_allocate_system_memory() for ROM
authorIgor Mammedov <imammedo@redhat.com>
Tue, 8 Oct 2019 11:33:18 +0000 (07:33 -0400)
committerEduardo Habkost <ehabkost@redhat.com>
Thu, 24 Oct 2019 02:37:42 +0000 (23:37 -0300)
machine_hppa_init() violates memory_region_allocate_system_memory() contract
by calling it multiple times which could break with -mem-path. Replace
the second usage (for 'rom') with memory_region_init_ram() instead.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20191008113318.7012-4-imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
hw/hppa/machine.c

index 7e2367542922a0652afde4500937849297812fcf..953d454f4879a3d3de7a172d261a5cbc81bcd7fb 100644 (file)
@@ -161,9 +161,8 @@ static void machine_hppa_init(MachineState *machine)
     g_free(firmware_filename);
 
     rom_region = g_new(MemoryRegion, 1);
-    memory_region_allocate_system_memory(rom_region, OBJECT(machine),
-                                         "firmware",
-                                         (FIRMWARE_END - FIRMWARE_START));
+    memory_region_init_ram(rom_region, NULL, "firmware",
+                           (FIRMWARE_END - FIRMWARE_START), &error_fatal);
     memory_region_add_subregion(addr_space, FIRMWARE_START, rom_region);
 
     /* Load kernel */