[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 068/106] numa: introduce memory_region_allocate_sy
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 068/106] numa: introduce memory_region_allocate_system_memory |
Date: |
Wed, 18 Jun 2014 19:20:00 +0300 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
MST: resolve conflicts
---
include/hw/boards.h | 6 +++++-
include/sysemu/sysemu.h | 1 +
hw/i386/pc.c | 3 +--
numa.c | 9 +++++++++
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 429ac43..605a970 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -43,9 +43,13 @@ struct QEMUMachine {
const char *hw_version;
};
-#define TYPE_MACHINE_SUFFIX "-machine"
+void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
+ const char *name,
+ uint64_t ram_size);
+
int qemu_register_machine(QEMUMachine *m);
+#define TYPE_MACHINE_SUFFIX "-machine"
#define TYPE_MACHINE "machine"
#undef MACHINE /* BSD defines it and QEMU does not use it */
#define MACHINE(obj) \
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 423d49e..caf88dd 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/hw/i386/pc.c b/hw/i386/pc.c
index ac7ac77..c674c1c 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1215,8 +1215,7 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
* with older qemus that used qemu_ram_alloc().
*/
ram = g_malloc(sizeof(*ram));
- memory_region_init_ram(ram, NULL, "pc.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "pc.ram", ram_size);
*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/numa.c b/numa.c
index 6fb0888..8bab784 100644
--- a/numa.c
+++ b/numa.c
@@ -32,6 +32,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",
@@ -193,3 +194,11 @@ void set_numa_modes(void)
}
}
}
+
+void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
+ const char *name,
+ uint64_t ram_size)
+{
+ memory_region_init_ram(mr, owner, name, ram_size);
+ vmstate_register_ram_global(mr);
+}
--
MST
- [Qemu-devel] [PULL v2 057/106] Add the vhost-user netdev backend to the command line, (continued)
- [Qemu-devel] [PULL v2 057/106] Add the vhost-user netdev backend to the command line, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 058/106] Add vhost-user protocol documentation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 059/106] libqemustub: add stubs to be able to use qemu-char.c, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 060/106] Add qtest for vhost-user, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 061/106] NUMA: move numa related code to new file numa.c, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 063/106] NUMA: Add numa_info structure to contain numa nodes info, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 064/106] NUMA: convert -numa option to use OptsVisitor, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 065/106] NUMA: expand MAX_NODES from 64 to 128, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 066/106] man: improve -numa doc, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 067/106] qmp: improve error reporting for -object and object-add, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 068/106] numa: introduce memory_region_allocate_system_memory,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 069/106] memory: reorganize file-based allocation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 070/106] memory: move preallocation code out of exec.c, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 071/106] memory: move RAM_PREALLOC_MASK to exec.c, rename, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 073/106] Introduce signed range., Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 075/106] numa: add -numa node, memdev= option, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 079/106] pc: pass MachineState to pc_memory_init, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 080/106] backend:hostmem: replace hostmemory with host_memory, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 081/106] hostmem: separate allocation from UserCreatable complete method, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 082/106] hostmem: add file-based HostMemoryBackend, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 083/106] hostmem: add merge and dump properties, Michael S. Tsirkin, 2014/06/18