Error *local_err = NULL;
MigrationIncomingState *mis = opaque;
- /* 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) {
- migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
- MIGRATION_STATUS_FAILED);
- error_report_err(local_err);
- migrate_decompress_threads_join();
- exit(EXIT_FAILURE);
+ 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;
}
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;
}
}
/* Continuing after completed migration. Images have been inactivated to
- * allow the destination to take control. Need to get control back now. */
- if (runstate_check(RUN_STATE_FINISH_MIGRATE) ||
- runstate_check(RUN_STATE_POSTMIGRATE))
- {
- bdrv_invalidate_cache_all(&local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
+ * allow the destination to take control. Need to get control back now.
+ *
+ * If there are no inactive block nodes (e.g. because the VM was just
+ * paused rather than completing a migration), bdrv_inactivate_all() simply
+ * doesn't do anything. */
+ bdrv_invalidate_cache_all(&local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
}
blk_resume_after_migration(&local_err);