From 7b0027a828009550eb2f8340924c78549aff5518 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sat, 3 Mar 2018 22:23:26 -0500 Subject: [PATCH] memory: Rename memory_region_init_ram() to memory_region_init_ram_nomigrate() Rename memory_region_init_ram() to memory_region_init_ram_nomigrate(). This leaves the way clear for us to provide a memory_region_init_ram() which does handle migration. Backports commit 1cfe48c1ce219b60a9096312f7a61806fae64ab3 from qemu --- qemu/aarch64.h | 2 +- qemu/aarch64eb.h | 2 +- qemu/arm.h | 2 +- qemu/armeb.h | 2 +- qemu/header_gen.py | 2 +- qemu/include/exec/memory.h | 19 ++++++++++--------- qemu/m68k.h | 2 +- qemu/memory.c | 15 ++++++++------- qemu/mips.h | 2 +- qemu/mips64.h | 2 +- qemu/mips64el.h | 2 +- qemu/mipsel.h | 2 +- qemu/powerpc.h | 2 +- qemu/sparc.h | 2 +- qemu/sparc64.h | 2 +- qemu/x86_64.h | 2 +- 16 files changed, 32 insertions(+), 30 deletions(-) diff --git a/qemu/aarch64.h b/qemu/aarch64.h index 05d03c4f..0691d8b7 100644 --- a/qemu/aarch64.h +++ b/qemu/aarch64.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_aarch64 #define memory_region_init_alias memory_region_init_alias_aarch64 #define memory_region_init_io memory_region_init_io_aarch64 -#define memory_region_init_ram memory_region_init_ram_aarch64 #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_aarch64 +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_aarch64 #define memory_region_init_ram_ptr memory_region_init_ram_ptr_aarch64 #define memory_region_init_reservation memory_region_init_reservation_aarch64 #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_aarch64 diff --git a/qemu/aarch64eb.h b/qemu/aarch64eb.h index 27f5a0a7..821e4ab6 100644 --- a/qemu/aarch64eb.h +++ b/qemu/aarch64eb.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_aarch64eb #define memory_region_init_alias memory_region_init_alias_aarch64eb #define memory_region_init_io memory_region_init_io_aarch64eb -#define memory_region_init_ram memory_region_init_ram_aarch64eb #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_aarch64eb +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_aarch64eb #define memory_region_init_ram_ptr memory_region_init_ram_ptr_aarch64eb #define memory_region_init_reservation memory_region_init_reservation_aarch64eb #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_aarch64eb diff --git a/qemu/arm.h b/qemu/arm.h index 1b6430d2..7c971152 100644 --- a/qemu/arm.h +++ b/qemu/arm.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_arm #define memory_region_init_alias memory_region_init_alias_arm #define memory_region_init_io memory_region_init_io_arm -#define memory_region_init_ram memory_region_init_ram_arm #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_arm +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_arm #define memory_region_init_ram_ptr memory_region_init_ram_ptr_arm #define memory_region_init_reservation memory_region_init_reservation_arm #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_arm diff --git a/qemu/armeb.h b/qemu/armeb.h index 4498a7e3..a54f623e 100644 --- a/qemu/armeb.h +++ b/qemu/armeb.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_armeb #define memory_region_init_alias memory_region_init_alias_armeb #define memory_region_init_io memory_region_init_io_armeb -#define memory_region_init_ram memory_region_init_ram_armeb #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_armeb +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_armeb #define memory_region_init_ram_ptr memory_region_init_ram_ptr_armeb #define memory_region_init_reservation memory_region_init_reservation_armeb #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_armeb diff --git a/qemu/header_gen.py b/qemu/header_gen.py index dc9ad018..f760c90b 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -2309,8 +2309,8 @@ symbols = ( 'memory_region_init', 'memory_region_init_alias', 'memory_region_init_io', - 'memory_region_init_ram', 'memory_region_init_ram_device_ptr', + 'memory_region_init_ram_nomigrate', 'memory_region_init_ram_ptr', 'memory_region_init_reservation', 'memory_region_init_resizeable_ram', diff --git a/qemu/include/exec/memory.h b/qemu/include/exec/memory.h index baaa02f3..08fdbeca 100644 --- a/qemu/include/exec/memory.h +++ b/qemu/include/exec/memory.h @@ -344,8 +344,9 @@ void memory_region_init_io(struct uc_struct *uc, uint64_t size); /** - * memory_region_init_ram: Initialize RAM memory region. Accesses into the - * region will modify memory directly. + * memory_region_init_ram_nomigrate: Initialize RAM memory region. Accesses + * into the region will modify memory + * directly. * * @mr: the #MemoryRegion to be initialized. * @owner: the object that tracks the region's reference count @@ -358,13 +359,13 @@ void memory_region_init_io(struct uc_struct *uc, * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the caller. */ -void memory_region_init_ram(struct uc_struct *uc, - MemoryRegion *mr, - struct Object *owner, - const char *name, - uint64_t size, - uint32_t perms, - Error **errp); +void memory_region_init_ram_nomigrate(struct uc_struct *uc, + MemoryRegion *mr, + struct Object *owner, + const char *name, + uint64_t size, + uint32_t perms, + Error **errp); /** * memory_region_init_ram_ptr: Initialize RAM memory region from a diff --git a/qemu/m68k.h b/qemu/m68k.h index 7facbfaa..66c12796 100644 --- a/qemu/m68k.h +++ b/qemu/m68k.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_m68k #define memory_region_init_alias memory_region_init_alias_m68k #define memory_region_init_io memory_region_init_io_m68k -#define memory_region_init_ram memory_region_init_ram_m68k #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_m68k +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_m68k #define memory_region_init_ram_ptr memory_region_init_ram_ptr_m68k #define memory_region_init_reservation memory_region_init_reservation_m68k #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_m68k diff --git a/qemu/memory.c b/qemu/memory.c index f7128f5b..4055ab5b 100644 --- a/qemu/memory.c +++ b/qemu/memory.c @@ -41,7 +41,7 @@ MemoryRegion *memory_map(struct uc_struct *uc, hwaddr begin, size_t size, uint32 { MemoryRegion *ram = g_new(MemoryRegion, 1); - memory_region_init_ram(uc, ram, NULL, "pc.ram", size, perms, &error_abort); + memory_region_init_ram_nomigrate(uc, ram, NULL, "pc.ram", size, perms, &error_abort); if (ram->ram_block == NULL) { // out of memory return NULL; @@ -1205,12 +1205,13 @@ void memory_region_init_io(struct uc_struct *uc, MemoryRegion *mr, mr->terminates = true; } -void memory_region_init_ram(struct uc_struct *uc, MemoryRegion *mr, - Object *owner, - const char *name, - uint64_t size, - uint32_t perms, - Error **errp) +void memory_region_init_ram_nomigrate(struct uc_struct *uc, + MemoryRegion *mr, + Object *owner, + const char *name, + uint64_t size, + uint32_t perms, + Error **errp) { memory_region_init(uc, mr, owner, name, size); mr->ram = true; diff --git a/qemu/mips.h b/qemu/mips.h index 64d8e16d..3f72ef2a 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_mips #define memory_region_init_alias memory_region_init_alias_mips #define memory_region_init_io memory_region_init_io_mips -#define memory_region_init_ram memory_region_init_ram_mips #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_mips +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_mips #define memory_region_init_ram_ptr memory_region_init_ram_ptr_mips #define memory_region_init_reservation memory_region_init_reservation_mips #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_mips diff --git a/qemu/mips64.h b/qemu/mips64.h index 060fff66..f9a15cdb 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_mips64 #define memory_region_init_alias memory_region_init_alias_mips64 #define memory_region_init_io memory_region_init_io_mips64 -#define memory_region_init_ram memory_region_init_ram_mips64 #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_mips64 +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_mips64 #define memory_region_init_ram_ptr memory_region_init_ram_ptr_mips64 #define memory_region_init_reservation memory_region_init_reservation_mips64 #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_mips64 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index eabee7d7..14d59353 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_mips64el #define memory_region_init_alias memory_region_init_alias_mips64el #define memory_region_init_io memory_region_init_io_mips64el -#define memory_region_init_ram memory_region_init_ram_mips64el #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_mips64el +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_mips64el #define memory_region_init_ram_ptr memory_region_init_ram_ptr_mips64el #define memory_region_init_reservation memory_region_init_reservation_mips64el #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_mips64el diff --git a/qemu/mipsel.h b/qemu/mipsel.h index e6a7ff30..2aeb1870 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_mipsel #define memory_region_init_alias memory_region_init_alias_mipsel #define memory_region_init_io memory_region_init_io_mipsel -#define memory_region_init_ram memory_region_init_ram_mipsel #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_mipsel +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_mipsel #define memory_region_init_ram_ptr memory_region_init_ram_ptr_mipsel #define memory_region_init_reservation memory_region_init_reservation_mipsel #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_mipsel diff --git a/qemu/powerpc.h b/qemu/powerpc.h index 4b25a0fa..20b9ea78 100644 --- a/qemu/powerpc.h +++ b/qemu/powerpc.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_powerpc #define memory_region_init_alias memory_region_init_alias_powerpc #define memory_region_init_io memory_region_init_io_powerpc -#define memory_region_init_ram memory_region_init_ram_powerpc #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_powerpc +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_powerpc #define memory_region_init_ram_ptr memory_region_init_ram_ptr_powerpc #define memory_region_init_reservation memory_region_init_reservation_powerpc #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_powerpc diff --git a/qemu/sparc.h b/qemu/sparc.h index 15a71832..10d01083 100644 --- a/qemu/sparc.h +++ b/qemu/sparc.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_sparc #define memory_region_init_alias memory_region_init_alias_sparc #define memory_region_init_io memory_region_init_io_sparc -#define memory_region_init_ram memory_region_init_ram_sparc #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_sparc +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_sparc #define memory_region_init_ram_ptr memory_region_init_ram_ptr_sparc #define memory_region_init_reservation memory_region_init_reservation_sparc #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_sparc diff --git a/qemu/sparc64.h b/qemu/sparc64.h index 370f1c51..55c418bc 100644 --- a/qemu/sparc64.h +++ b/qemu/sparc64.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_sparc64 #define memory_region_init_alias memory_region_init_alias_sparc64 #define memory_region_init_io memory_region_init_io_sparc64 -#define memory_region_init_ram memory_region_init_ram_sparc64 #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_sparc64 +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_sparc64 #define memory_region_init_ram_ptr memory_region_init_ram_ptr_sparc64 #define memory_region_init_reservation memory_region_init_reservation_sparc64 #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_sparc64 diff --git a/qemu/x86_64.h b/qemu/x86_64.h index d86b0ab2..86e77c7e 100644 --- a/qemu/x86_64.h +++ b/qemu/x86_64.h @@ -2303,8 +2303,8 @@ #define memory_region_init memory_region_init_x86_64 #define memory_region_init_alias memory_region_init_alias_x86_64 #define memory_region_init_io memory_region_init_io_x86_64 -#define memory_region_init_ram memory_region_init_ram_x86_64 #define memory_region_init_ram_device_ptr memory_region_init_ram_device_ptr_x86_64 +#define memory_region_init_ram_nomigrate memory_region_init_ram_nomigrate_x86_64 #define memory_region_init_ram_ptr memory_region_init_ram_ptr_x86_64 #define memory_region_init_reservation memory_region_init_reservation_x86_64 #define memory_region_init_resizeable_ram memory_region_init_resizeable_ram_x86_64