Hi all! I'm resending this now, as Eric started to review v2 and it occurs outdated.
Last time it was somehow postponed, and I thought that I'll to rebase it onto Max's "[PATCH v2 0/3] migration: Add block-bitmap-mapping parameter" Of course, if this goes into 5.1, Max's series will need a rebase, sorry for this. So we need to decide now, do we really want this in 5.1? pros: it fixes real problems cons: - it affects migration in invasive way. Still, it may be not bad, if we double check that it don't affect migration when dirty-bitmaps migration capability is disabled (the default). - seems, there are at least one more crash which Max found. I don't remember now, if I reproduced it on top of my series or not... If we decide, that it goes to 5.2, than again, let's decide which series goes first. I'm OK either way, and can rebase this series, or rebase Max's series myself, if he will not have time (I fill responsive for all this mess, sorry). Max, please look at this series if you have some time, you are familiar with code now. ==== Original idea of bitmaps postcopy migration is that bitmaps are non critical data, and their loss is not serious problem. So, using postcopy method on any failure we should just drop unfinished bitmaps and continue guest execution. However, it doesn't work so. It crashes, fails, it goes to postcopy-recovery feature. It does anything except for behavior we want. These series fixes at least some problems with error handling during bitmaps migration postcopy. ==== v3: - 199-iotest improvements moved to the beginning of the series, v2:0018 already merged upstream. - add r-b and t-b marks by Andrey and Eric 03: rename same variables [Andrey] 05,06: update commit msg 08: some changes due to rebase, still, keep Eric's and Andrey's r-bs 11: rebased, drop r-b 14: s/,/;/ 15: handle cancelled at start of dirty_bitmap_load_start() 17: Modify error message a bit, keep r-bs 18: Rebased on 03 changes 20: add comment v2: Most of patches are new or changed a lot. Only patches 06,07 mostly unchanged, just rebased on refactorings. v1 was "[PATCH 0/7] Fix crashes on early shutdown during bitmaps postcopy" Vladimir Sementsov-Ogievskiy (21): qemu-iotests/199: fix style qemu-iotests/199: drop extra constraints qemu-iotests/199: better catch postcopy time qemu-iotests/199: improve performance: set bitmap by discard qemu-iotests/199: change discard patterns qemu-iotests/199: increase postcopy period migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start migration/block-dirty-bitmap: rename state structure types migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init migration/block-dirty-bitmap: refactor state global variables migration/block-dirty-bitmap: rename finish_lock to just lock migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete migration/block-dirty-bitmap: keep bitmap state for all bitmaps migration/block-dirty-bitmap: relax error handling in incoming part migration/block-dirty-bitmap: cancel migration on shutdown migration/savevm: don't worry if bitmap migration postcopy failed qemu-iotests/199: prepare for new test-cases addition qemu-iotests/199: check persistent bitmaps qemu-iotests/199: add early shutdown case to bitmaps postcopy qemu-iotests/199: add source-killed case to bitmaps postcopy migration/migration.h | 3 +- migration/block-dirty-bitmap.c | 458 +++++++++++++++++++++------------ migration/migration.c | 15 +- migration/savevm.c | 37 ++- tests/qemu-iotests/199 | 250 ++++++++++++++---- tests/qemu-iotests/199.out | 4 +- 6 files changed, 535 insertions(+), 232 deletions(-) -- 2.21.0