aboutsummaryrefslogtreecommitdiff
path: root/arch_init.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-12-12 12:54:43 +0100
committerJuan Quintela <quintela@redhat.com>2012-12-20 22:44:29 +0100
commit244eaa7514a944b36273eb8428f32da8e9124fcf (patch)
tree5b6196ca6c17d2e27502aa428074d1fcb496f5db /arch_init.c
parent27dd7730582be85c7d4f680f5f71146629809c86 (diff)
migration: fix migration_bitmap leak
Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r--arch_init.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch_init.c b/arch_init.c
index a8b65416da..e01f0e5ea1 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -535,9 +535,13 @@ static void sort_ram_list(void)
static void migration_end(void)
{
- memory_global_dirty_log_stop();
+ if (migration_bitmap) {
+ memory_global_dirty_log_stop();
+ g_free(migration_bitmap);
+ migration_bitmap = NULL;
+ }
- if (migrate_use_xbzrle()) {
+ if (XBZRLE.cache) {
cache_fini(XBZRLE.cache);
g_free(XBZRLE.cache);
g_free(XBZRLE.encoded_buf);
@@ -689,13 +693,10 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
}
bytes_transferred += bytes_sent;
}
- memory_global_dirty_log_stop();
+ migration_end();
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
- g_free(migration_bitmap);
- migration_bitmap = NULL;
-
return 0;
}