From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxIaQ-0002jP-8C for qemu-devel@nongnu.org; Wed, 18 Jun 2014 12:19:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxIaK-00080p-NM for qemu-devel@nongnu.org; Wed, 18 Jun 2014 12:19:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxIaK-00080T-Ft for qemu-devel@nongnu.org; Wed, 18 Jun 2014 12:19:40 -0400 Date: Wed, 18 Jun 2014 19:20:00 +0300 From: "Michael S. Tsirkin" Message-ID: <1403108034-32054-69-git-send-email-mst@redhat.com> References: <1403108034-32054-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1403108034-32054-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 068/106] numa: introduce memory_region_allocate_system_memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Eduardo Habkost , Marcel Apfelbaum , Hu Tao , Alexander Graf , Markus Armbruster , Anthony Liguori , Paolo Bonzini , =?us-ascii?B?PT9VVEYtOD9xP0FuZHJlYXM9MjBGPUMzPUE0cmJlcj89?= , Wanlong Gao From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Hu Tao Signed-off-by: Michael S. Tsirkin Acked-by: Michael S. Tsirkin Reviewed-by: Eduardo Habkost Signed-off-by: Michael S. Tsirkin 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