migration/block-dirty-bitmap: cancel migration on shutdown
commit1499ab096950364d634418e7aefb562694d6c953
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 27 Jul 2020 19:42:31 +0000 (27 22:42 +0300)
committerEric Blake <eblake@redhat.com>
Mon, 27 Jul 2020 20:41:34 +0000 (27 15:41 -0500)
tree1c14e419cf5254b34a4945064f5b3af7cd92c0d5
parentb91f33b81df7439ac504f4737c3e529ec2bf0525
migration/block-dirty-bitmap: cancel migration on shutdown

If target is turned off prior to postcopy finished, target crashes
because busy bitmaps are found at shutdown.
Canceling incoming migration helps, as it removes all unfinished (and
therefore busy) bitmaps.

Similarly on source we crash in bdrv_close_all which asserts that all
bdrv states are removed, because bdrv states involved into dirty bitmap
migration are referenced by it. So, we need to cancel outgoing
migration as well.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Message-Id: <20200727194236.19551-17-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
migration/block-dirty-bitmap.c
migration/migration.c
migration/migration.h