summaryrefslogtreecommitdiff
path: root/migration/savevm.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-05-04 18:52:36 +0200
committerKevin Wolf <kwolf@redhat.com>2017-05-11 12:08:24 +0200
commitace21a58751824f9a3d399e332317233e880de3a (patch)
treed4486c7e1932c50d5390939f446510a89750829a /migration/savevm.c
parentaa93c834f9c5b971ad3b54944a5dae97ca310225 (diff)
downloadqemu-ace21a58751824f9a3d399e332317233e880de3a.zip
migration: Unify block node activation error handling
Migration code activates all block driver nodes on the destination when the migration completes. It does so by calling bdrv_invalidate_cache_all() and blk_resume_after_migration(). There is one code path for precopy and one for postcopy migration, resulting in four function calls, which used to have three different failure modes. This patch unifies the behaviour so that failure to activate all block nodes is non-fatal, but the error message is logged and the VM isn't automatically started. 'cont' will retry activating the block nodes. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'migration/savevm.c')
-rw-r--r--migration/savevm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index 352a8f23b5..3ca8d11704 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1612,16 +1612,14 @@ static void loadvm_postcopy_handle_run_bh(void *opaque)
qemu_announce_self();
- /* Make sure all file formats flush their mutable metadata */
+ /* Make sure all file formats flush their mutable metadata.
+ * If we get an error here, just don't restart the VM yet. */
bdrv_invalidate_cache_all(&local_err);
- if (local_err) {
- error_report_err(local_err);
+ if (!local_err) {
+ blk_resume_after_migration(&local_err);
}
-
- /* If we get an error here, just don't restart the VM yet. */
- blk_resume_after_migration(&local_err);
if (local_err) {
- error_free(local_err);
+ error_report_err(local_err);
local_err = NULL;
autostart = false;
}