diff mbox

[RFC,v3,1/3] hw/arm/virt: Use memory_region_allocate_system_memory to allocate memory

Message ID 1420523839-11672-2-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao Jan. 6, 2015, 5:57 a.m. UTC
Use memory_region_allocate_system_memory to allocate memory.
The function is sensitive to NUMA and can allocate memory
for NUMA topology.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
---
 hw/arm/virt.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 2353440..fdafa79 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -627,9 +627,8 @@  static void machvirt_init(MachineState *machine)
     fdt_add_cpu_nodes(vbi);
     fdt_add_psci_node(vbi);
 
-    memory_region_init_ram(ram, NULL, "mach-virt.ram", machine->ram_size,
-                           &error_abort);
-    vmstate_register_ram_global(ram);
+    memory_region_allocate_system_memory(ram, NULL, "mach-virt.ram",
+                                         machine->ram_size);
     memory_region_add_subregion(sysmem, vbi->memmap[VIRT_MEM].base, ram);
 
     create_flash(vbi);