]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
block-migration: Flush requests in blk_mig_cleanup
authorKevin Wolf <kwolf@redhat.com>
Tue, 25 Sep 2012 13:47:36 +0000 (15:47 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 28 Sep 2012 15:43:28 +0000 (17:43 +0200)
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 <pl@dlhnet.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block-migration.c

index 7def8ab197719e7f16f075a7ee404df8532fface..ed933017f95bd9637879d49f69bb9c40b2138afc 100644 (file)
@@ -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) {