Patchwork [01/30] block-migration: Flush requests in blk_mig_cleanup

login
register
mail settings
Submitter Kevin Wolf
Date Sept. 28, 2012, 5:56 p.m.
Message ID <1348855033-17174-2-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/187849/
State New
Headers show

Comments

Kevin Wolf - Sept. 28, 2012, 5:56 p.m.
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 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/block-migration.c b/block-migration.c
index 7def8ab..ed93301 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) {