[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2.1 13/28] numa: introduce memory_region_allocate_sy
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 2.1 13/28] numa: introduce memory_region_allocate_system_memory |
Date: |
Tue, 4 Mar 2014 15:00:41 +0100 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/pc.c | 4 +---
include/hw/boards.h | 4 ++++
include/sysemu/sysemu.h | 1 +
numa.c | 11 +++++++++++
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 17d4820..ff078fb 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1165,9 +1165,7 @@ FWCfgState *pc_memory_init(QEMUMachineInitArgs *args,
* with older qemus that used qemu_ram_alloc().
*/
ram = g_malloc(sizeof(*ram));
- memory_region_init_ram(ram, NULL, "pc.ram",
- below_4g_mem_size + above_4g_mem_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "pc.ram", args);
*ram_memory = ram;
ram_below_4g = g_malloc(sizeof(*ram_below_4g));
memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", ram,
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 2151460..8b68878 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -48,6 +48,10 @@ struct QEMUMachine {
const char *hw_version;
};
+void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
+ const char *name,
+ QEMUMachineInitArgs *args);
+
int qemu_register_machine(QEMUMachine *m);
QEMUMachine *find_default_machine(void);
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 4c94cf5..54a6f28 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -10,6 +10,7 @@
#include "qemu/notify.h"
#include "qemu/main-loop.h"
#include "qemu/bitmap.h"
+#include "qom/object.h"
/* vl.c */
diff --git a/numa.c b/numa.c
index 6563232..930f49d 100644
--- a/numa.c
+++ b/numa.c
@@ -31,6 +31,7 @@
#include "qapi/opts-visitor.h"
#include "qapi/dealloc-visitor.h"
#include "qapi/qmp/qerror.h"
+#include "hw/boards.h"
QemuOptsList qemu_numa_opts = {
.name = "numa",
@@ -191,3 +192,13 @@ void set_numa_modes(void)
}
}
}
+
+void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
+ const char *name,
+ QEMUMachineInitArgs *args)
+{
+ uint64_t ram_size = args->ram_size;
+
+ memory_region_init_ram(mr, owner, name, ram_size);
+ vmstate_register_ram_global(mr);
+}
--
1.8.5.3
- Re: [Qemu-devel] [PATCH 2.1 08/28] vl: convert -m to QemuOpts, (continued)
- [Qemu-devel] [PATCH 2.1 09/28] vl: redo -object parsing, Paolo Bonzini, 2014/03/04
- [Qemu-devel] [PATCH 2.1 10/28] qmp: allow object-add completion handler to get canonical path, Paolo Bonzini, 2014/03/04
- [Qemu-devel] [PATCH 2.1 11/28] qmp: improve error reporting for -object and object-add, Paolo Bonzini, 2014/03/04
- [Qemu-devel] [PATCH 2.1 12/28] pc: pass QEMUMachineInitArgs to pc_memory_init, Paolo Bonzini, 2014/03/04
- [Qemu-devel] [PATCH 2.1 13/28] numa: introduce memory_region_allocate_system_memory,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 2.1 14/28] add memdev backend infrastructure, Paolo Bonzini, 2014/03/04
- [Qemu-devel] [PATCH 2.1 15/28] numa: add -numa node, memdev= option, Paolo Bonzini, 2014/03/04
- [Qemu-devel] [PATCH 2.1 16/28] memory: reorganize file-based allocation, Paolo Bonzini, 2014/03/04