[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 32/33] migration: push Error **errp into postcopy_resume_handshak
From: |
Daniel P . Berrangé |
Subject: |
[PATCH 32/33] migration: push Error **errp into postcopy_resume_handshake() |
Date: |
Thu, 4 Feb 2021 17:19:06 +0000 |
This is an incremental step in converting vmstate loading code to report
via Error objects instead of printing directly to the console/monitor.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
migration/migration.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 3f0586842d..32a61b04bf 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3146,7 +3146,7 @@ typedef enum MigThrError {
MIG_THR_ERR_FATAL = 2,
} MigThrError;
-static int postcopy_resume_handshake(MigrationState *s)
+static int postcopy_resume_handshake(MigrationState *s, Error **errp)
{
qemu_savevm_send_postcopy_resume(s->to_dst_file);
@@ -3158,13 +3158,14 @@ static int postcopy_resume_handshake(MigrationState *s)
return 0;
}
+ error_setg(errp, "postcopy resume handshake failed state %x != %x",
+ s->state, MIGRATION_STATUS_POSTCOPY_ACTIVE);
return -1;
}
/* Return zero if success, or <0 for error */
static int postcopy_do_resume(MigrationState *s)
{
- int ret;
Error *local_err = NULL;
/*
@@ -3180,10 +3181,9 @@ static int postcopy_do_resume(MigrationState *s)
* Last handshake with destination on the resume (destination will
* switch to postcopy-active afterwards)
*/
- ret = postcopy_resume_handshake(s);
- if (ret) {
- error_report("%s: handshake failed: %d", __func__, ret);
- return ret;
+ if (postcopy_resume_handshake(s, &local_err) < 0) {
+ error_report_err(local_err);
+ return -1;
}
return 0;
--
2.29.2
- [PATCH 23/33] migration: simplify some error reporting in save_snapshot(), (continued)
- [PATCH 23/33] migration: simplify some error reporting in save_snapshot(), Daniel P . Berrangé, 2021/02/04
- [PATCH 19/33] migration: push Error **errp into check_section_footer(), Daniel P . Berrangé, 2021/02/04
- [PATCH 21/33] migration: remove error reporting from qemu_fopen_bdrv() callers, Daniel P . Berrangé, 2021/02/04
- [PATCH 20/33] migration: push Error **errp into global_state_store(), Daniel P . Berrangé, 2021/02/04
- [PATCH 25/33] migration: push Error **errp into qemu_savevm_state_complete_precopy(), Daniel P . Berrangé, 2021/02/04
- [PATCH 22/33] migration: push Error **errp into qemu_savevm_state_iterate(), Daniel P . Berrangé, 2021/02/04
- [PATCH 28/33] migration: push Error **errp into qemu_savevm_send_packaged(), Daniel P . Berrangé, 2021/02/04
- [PATCH 31/33] migration: push Error **errp into qemu_savevm_state_resume_prepare(), Daniel P . Berrangé, 2021/02/04
- [PATCH 26/33] migration: push Error **errp into qemu_savevm_state_complete_precopy_non_iterable(), Daniel P . Berrangé, 2021/02/04
- [PATCH 32/33] migration: push Error **errp into postcopy_resume_handshake(),
Daniel P . Berrangé <=
- [PATCH 27/33] migration: push Error **errp into qemu_savevm_state_complete_precopy(), Daniel P . Berrangé, 2021/02/04
- [PATCH 24/33] migration: push Error **errp into qemu_savevm_state_setup(), Daniel P . Berrangé, 2021/02/04
- [PATCH 29/33] migration: push Error **errp into qemu_savevm_live_state(), Daniel P . Berrangé, 2021/02/04
- [PATCH 30/33] migration: push Error **errp into qemu_save_device_state(), Daniel P . Berrangé, 2021/02/04
- [PATCH 33/33] migration: push Error **errp into postcopy_do_resume(), Daniel P . Berrangé, 2021/02/04
- Re: [PATCH 00/33] migration: capture error reports into Error object, Dr. David Alan Gilbert, 2021/02/04