[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] [qemu-devel] fix wrong order when doing live block
From: |
chai wen |
Subject: |
[Qemu-devel] [PATCH] [qemu-devel] fix wrong order when doing live block migration setup |
Date: |
Tue, 27 May 2014 16:54:41 +0800 |
If we want to track dirty blocks using dirty_maps on a BlockDriverState
when doing live block-migration, its correspoding 'BlkMigDevState' should be
add to block_mig_state.bmds_list firstly for subsequent processing.
Otherwise set_dirty_tracking will do nothing on an empty list than allocating
dirty_bitmaps for them.
And what's the worse, bdrv_get_dirty_count will access the
bmds->dirty_maps directly, there could be a segfault as the reasons
above.
Signed-off-by: chai wen <address@hidden>
---
block-migration.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index 56951e0..43203aa 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -626,6 +626,7 @@ static int block_save_setup(QEMUFile *f, void *opaque)
block_mig_state.submitted, block_mig_state.transferred);
qemu_mutex_lock_iothread();
+ init_blk_migration(f);
/* start track dirty blocks */
ret = set_dirty_tracking();
@@ -635,7 +636,6 @@ static int block_save_setup(QEMUFile *f, void *opaque)
return ret;
}
- init_blk_migration(f);
qemu_mutex_unlock_iothread();
--
1.7.1
- [Qemu-devel] [PATCH] [qemu-devel] fix wrong order when doing live block migration setup,
chai wen <=