Skip to contentSkip to conversation

migration: show error message when postcopy fails

PATCH In review Daniel P. Berrangé 2 participants 2 messages Jul 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: show error message when postcopy fails

The 'info migrate' command only shows the error message when the migration state is 'failed'. When postcopy is used, however, the 'postcopy-paused' state is used instead of 'failed', so we must show the error message there too.

---
 migration/migration-hmp-cmds.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
migration/migration-hmp-cmds.c +2 -1
index cef5608210..07fd227edc 100644
@@ -153,7 +153,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
     if (info->has_status) {
         monitor_printf(mon, "Status: \t\t%s",
                        MigrationStatus_str(info->status));
-        if (info->status == MIGRATION_STATUS_FAILED && info->error_desc) {
+        if ((info->status == MIGRATION_STATUS_FAILED ||
+             info->status == MIGRATION_STATUS_POSTCOPY_PAUSED) && info->error_desc) {
             monitor_printf(mon, " (%s)\n", info->error_desc);
         } else {
             monitor_printf(mon, "\n");
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Daniel P. Berrangé

The 'info migrate' command only shows the error message when the migration state is 'failed'. When postcopy is used, however, the 'postcopy-paused' state is used instead of 'failed', so we must show the error message there too.

---
 migration/migration-hmp-cmds.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
migration/migration-hmp-cmds.c +0 -0
index cef5608210..07fd227edc 100644

migration/migration-hmp-cmds.c void hmp_info_migrate(Monitor *mon, const QDict *qdict) · line 160

Quoted 9 lines
migration/migration-hmp-cmds.c +2 -1
@@ -153,7 +153,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
     if (info->has_status) {
         monitor_printf(mon, "Status: \t\t%s",
                        MigrationStatus_str(info->status));
-        if (info->status == MIGRATION_STATUS_FAILED && info->error_desc) {
+        if ((info->status == MIGRATION_STATUS_FAILED ||
+             info->status == MIGRATION_STATUS_POSTCOPY_PAUSED) && info->error_desc) {
             monitor_printf(mon, " (%s)\n", info->error_desc);
         } else {
             monitor_printf(mon, "\n");

queued