MIGRATION_STATUS_CANCELLED);
}
- if (s->error) {
- /* It is used on info migrate. We can't free it */
- error_report_err(error_copy(s->error));
- }
type = migration_has_failed(s) ? MIG_EVENT_PRECOPY_FAILED :
MIG_EVENT_PRECOPY_DONE;
migration_call_notifiers(type, NULL);
static void migration_cleanup_bh(void *opaque)
{
- migration_cleanup(opaque);
+ MigrationState *s = opaque;
+
+ migration_cleanup(s);
+ if (s->error) {
+ error_report_err(error_copy(s->error));
+ }
}
/*
s->expected_downtime = migrate_downtime_limit();
if (error_in) {
migration_connect_error_propagate(s, error_in);
- if (resume) {
- /*
- * Don't do cleanup for resume if channel is invalid, but only dump
- * the error. We wait for another channel connect from the user.
- * The error_report still gives HMP user a hint on what failed.
- * It's normally done in migration_cleanup(), but call it here
- * explicitly.
- */
- error_report_err(error_copy(s->error));
- } else {
+ if (!resume) {
migration_cleanup(s);
}
+ if (s->error) {
+ error_report_err(error_copy(s->error));
+ }
return;
}
if (s->state != MIGRATION_STATUS_CANCELLING) {
migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
}
- error_report_err(local_err);
migration_cleanup(s);
+ if (s->error) {
+ error_report_err(error_copy(s->error));
+ }
}
static void migration_class_init(ObjectClass *klass, const void *data)