]> git.proxmox.com Git - mirror_qemu.git/commitdiff
numa: introduce memory_region_allocate_system_memory
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 14 May 2014 09:43:15 +0000 (17:43 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 19 Jun 2014 15:44:19 +0000 (18:44 +0300)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
MST: resolve conflicts

hw/i386/pc.c
include/hw/boards.h
include/sysemu/sysemu.h
numa.c

index ac7ac774e6dc8e770669b05dd3ed7c3612ceddfe..c674c1c796b65ba90fd0a802405e9b15332fc0af 100644 (file)
@@ -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,
index 429ac43abc56a21c685221e597783c64afb14dc9..605a97093476b77205ab7578f593dc4d997069cb 100644 (file)
@@ -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) \
index 423d49efc6c313665093b5588a5fb0660360f54d..caf88dd8705bc36c581ffb33cb49cd3711d428db 100644 (file)
@@ -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 6fb0888d607f6071fb82582486f79fbee4473986..8bab784a3ee5b56256a4fd1a3e5eee461152f4b1 100644 (file)
--- 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);
+}