[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 61/65] migration: Display error in query-migrate irrelevant of sta
From: |
Juan Quintela |
Subject: |
[PULL 61/65] migration: Display error in query-migrate irrelevant of status |
Date: |
Wed, 11 Oct 2023 11:21:59 +0200 |
From: Peter Xu <peterx@redhat.com>
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>
---
qapi/migration.json | 5 ++---
migration/migration.c | 8 +++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/qapi/migration.json b/qapi/migration.json
index d8f3bbd7b0..d7dfaa5db9 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -230,9 +230,8 @@
# throttled during auto-converge. This is only present when
# auto-converge has started throttling guest cpus. (Since 2.7)
#
-# @error-desc: the human readable error description string, when
-# @status is 'failed'. Clients should not attempt to parse the
-# error strings. (Since 2.7)
+# @error-desc: the human readable error description string. Clients
+# should not attempt to parse the error strings. (Since 2.7)
#
# @postcopy-blocktime: total time when all vCPU were blocked during
# postcopy live migration. This is only present when the
diff --git a/migration/migration.c b/migration/migration.c
index 2057e42134..57f9e9ed0c 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1060,9 +1060,6 @@ static void fill_source_migration_info(MigrationInfo
*info)
break;
case MIGRATION_STATUS_FAILED:
info->has_status = true;
- if (s->error) {
- info->error_desc = g_strdup(error_get_pretty(s->error));
- }
break;
case MIGRATION_STATUS_CANCELLED:
info->has_status = true;
@@ -1072,6 +1069,11 @@ static void fill_source_migration_info(MigrationInfo
*info)
break;
}
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)
--
2.41.0
- [PULL 53/65] migration/rdma: Silence qemu_rdma_connect(), (continued)
- [PULL 53/65] migration/rdma: Silence qemu_rdma_connect(), Juan Quintela, 2023/10/11
- [PULL 52/65] migration/rdma: Silence qemu_rdma_resolve_host(), Juan Quintela, 2023/10/11
- [PULL 55/65] migration/rdma: Don't report received completion events as error, Juan Quintela, 2023/10/11
- [PULL 54/65] migration/rdma: Silence qemu_rdma_reg_control(), Juan Quintela, 2023/10/11
- [PULL 57/65] migration/rdma: Silence qemu_rdma_register_and_get_keys(), Juan Quintela, 2023/10/11
- [PULL 56/65] migration/rdma: Silence qemu_rdma_block_for_wrid(), Juan Quintela, 2023/10/11
- [PULL 58/65] migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings, Juan Quintela, 2023/10/11
- [PULL 59/65] migration/rdma: Use error_report() & friends instead of stderr, Juan Quintela, 2023/10/11
- [PULL 62/65] migration: Introduce migrate_has_error(), Juan Quintela, 2023/10/11
- [PULL 64/65] migration: Remember num of ramblocks to sync during recovery, Juan Quintela, 2023/10/11
- [PULL 61/65] migration: Display error in query-migrate irrelevant of status,
Juan Quintela <=
- [PULL 60/65] migration/rdma: Replace flawed device detail dump by tracing, Juan Quintela, 2023/10/11
- [PULL 63/65] qemufile: Always return a verbose error, Juan Quintela, 2023/10/11
- [PULL 65/65] migration: Add migration_rp_wait|kick(), Juan Quintela, 2023/10/11
- Re: [PULL 00/65] Migration 20231011 patches, Stefan Hajnoczi, 2023/10/11