migration: Display error in query-migrate irrelevant of status
Display it as long as being set, irrelevant of FAILED status. E.g., it may also be applicable to PAUSED stage of postcopy, to provide hint on what has gone wrong. The error_mutex seems to be overlooked when referencing the error, add it to be very safe. This will change QAPI behavior by showing up error message outside !FAILED status, but it's intended and doesn't expect to break anyone. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2018404 Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231004220240.167175-2-peterx@redhat.com>
This commit is contained in:
parent
2c88739cfd
commit
c94143e587
|
@ -1060,9 +1060,6 @@ static void fill_source_migration_info(MigrationInfo *info)
|
||||||
break;
|
break;
|
||||||
case MIGRATION_STATUS_FAILED:
|
case MIGRATION_STATUS_FAILED:
|
||||||
info->has_status = true;
|
info->has_status = true;
|
||||||
if (s->error) {
|
|
||||||
info->error_desc = g_strdup(error_get_pretty(s->error));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MIGRATION_STATUS_CANCELLED:
|
case MIGRATION_STATUS_CANCELLED:
|
||||||
info->has_status = true;
|
info->has_status = true;
|
||||||
|
@ -1072,6 +1069,11 @@ static void fill_source_migration_info(MigrationInfo *info)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
info->status = state;
|
info->status = state;
|
||||||
|
|
||||||
|
QEMU_LOCK_GUARD(&s->error_mutex);
|
||||||
|
if (s->error) {
|
||||||
|
info->error_desc = g_strdup(error_get_pretty(s->error));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fill_destination_migration_info(MigrationInfo *info)
|
static void fill_destination_migration_info(MigrationInfo *info)
|
||||||
|
|
|
@ -230,9 +230,8 @@
|
||||||
# throttled during auto-converge. This is only present when
|
# throttled during auto-converge. This is only present when
|
||||||
# auto-converge has started throttling guest cpus. (Since 2.7)
|
# auto-converge has started throttling guest cpus. (Since 2.7)
|
||||||
#
|
#
|
||||||
# @error-desc: the human readable error description string, when
|
# @error-desc: the human readable error description string. Clients
|
||||||
# @status is 'failed'. Clients should not attempt to parse the
|
# should not attempt to parse the error strings. (Since 2.7)
|
||||||
# error strings. (Since 2.7)
|
|
||||||
#
|
#
|
||||||
# @postcopy-blocktime: total time when all vCPU were blocked during
|
# @postcopy-blocktime: total time when all vCPU were blocked during
|
||||||
# postcopy live migration. This is only present when the
|
# postcopy live migration. This is only present when the
|
||||||
|
|
Loading…
Reference in New Issue