diff options
author | Avi Kivity <avi@redhat.com> | 2011-12-20 15:59:12 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-01-04 13:34:48 +0200 |
commit | c5705a7728b4a6bc9e4f2d35911adbaf28042b25 (patch) | |
tree | e96a1e0c9fbd0fa3624b5454038659775c81fba2 /hw/xtensa_lx60.c | |
parent | 8991c79b57b75fcdeb290df89b9b0adaccb0303c (diff) |
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it for
live migration. This differs from other state (which is enumerated
in a VMStateDescription structure) and ties the live migration code
into the memory core.
Decouple the two by introducing a separate API, vmstate_register_ram(),
for registering a RAM block for migration. Currently the same
implementation is reused, but later it can be moved into a separate list,
and registrations can be moved to VMStateDescription blocks.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/xtensa_lx60.c')
-rw-r--r-- | hw/xtensa_lx60.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/xtensa_lx60.c b/hw/xtensa_lx60.c index 8947157bfc..26112c3eb0 100644 --- a/hw/xtensa_lx60.c +++ b/hw/xtensa_lx60.c @@ -136,7 +136,8 @@ static void lx60_net_init(MemoryRegion *address_space, sysbus_mmio_get_region(s, 1)); ram = g_malloc(sizeof(*ram)); - memory_region_init_ram(ram, NULL, "open_eth.ram", 16384); + memory_region_init_ram(ram, "open_eth.ram", 16384); + vmstate_register_ram_global(ram); memory_region_add_subregion(address_space, buffers, ram); } @@ -186,7 +187,8 @@ static void lx_init(const LxBoardDesc *board, } ram = g_malloc(sizeof(*ram)); - memory_region_init_ram(ram, NULL, "lx60.dram", ram_size); + memory_region_init_ram(ram, "lx60.dram", ram_size); + vmstate_register_ram_global(ram); memory_region_add_subregion(system_memory, 0, ram); system_io = g_malloc(sizeof(*system_io)); @@ -221,7 +223,8 @@ static void lx_init(const LxBoardDesc *board, /* Use presence of kernel file name as 'boot from SRAM' switch. */ if (kernel_filename) { rom = g_malloc(sizeof(*rom)); - memory_region_init_ram(rom, NULL, "lx60.sram", board->sram_size); + memory_region_init_ram(rom, "lx60.sram", board->sram_size); + vmstate_register_ram_global(rom); memory_region_add_subregion(system_memory, 0xfe000000, rom); /* Put kernel bootparameters to the end of that SRAM */ |