From: Kevin Wolf Date: Tue, 25 Sep 2012 13:47:36 +0000 (+0200) Subject: block-migration: Flush requests in blk_mig_cleanup X-Git-Tag: v1.3.0-rc0~394^2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=946d58be1533bf843b499df12e1d9f97b28245c8;p=thirdparty%2Fqemu.git block-migration: Flush requests in blk_mig_cleanup When cancelling block migration, all in-flight requests of the block migration must be completed before the data can be freed. This was visible as failing assertions and segfaults. Reported-by: Peter Lieven Signed-off-by: Kevin Wolf --- diff --git a/block-migration.c b/block-migration.c index 7def8ab1977..ed933017f95 100644 --- a/block-migration.c +++ b/block-migration.c @@ -519,6 +519,8 @@ static void blk_mig_cleanup(void) BlkMigDevState *bmds; BlkMigBlock *blk; + bdrv_drain_all(); + set_dirty_tracking(0); while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {