Patchwork [2/3] exynos4210.c: register chipid_mem and rom_mem with vmstate

login
register
mail settings
Submitter Igor Mitsyanko
Date March 10, 2013, 2:21 p.m.
Message ID <1362925309-3852-3-git-send-email-i.mitsyanko@gmail.com>
Download mbox | patch
Permalink /patch/226447/
State New
Headers show

Comments

Igor Mitsyanko - March 10, 2013, 2:21 p.m.
Even if we do not register newly created RAM MemoryRegion for migration with
vmstate_register_ram_global() function, ram_save_setup() still saves this region
to snapshot file with empty idstr=="". Consequently this results in error during
VM loading in ram_load().
Register chipid_mem and rom_mem for migration.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
---
 hw/exynos4210.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/exynos4210.c b/hw/exynos4210.c
index 280d5d4..af741e2 100644
--- a/hw/exynos4210.c
+++ b/hw/exynos4210.c
@@ -221,6 +221,7 @@  Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
     /* Chip-ID and OMR */
     memory_region_init_ram_ptr(&s->chipid_mem, "exynos4210.chipid",
             sizeof(chipid_and_omr), chipid_and_omr);
+    vmstate_register_ram_global(&s->chipid_mem);
     memory_region_set_readonly(&s->chipid_mem, true);
     memory_region_add_subregion(system_mem, EXYNOS4210_CHIPID_ADDR,
                                 &s->chipid_mem);
@@ -228,6 +229,7 @@  Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
     /* Internal ROM */
     memory_region_init_ram(&s->irom_mem, "exynos4210.irom",
                            EXYNOS4210_IROM_SIZE);
+    vmstate_register_ram_global(&s->irom_mem);
     memory_region_set_readonly(&s->irom_mem, true);
     memory_region_add_subregion(system_mem, EXYNOS4210_IROM_BASE_ADDR,
                                 &s->irom_mem);