[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 33/33] migration: push Error **errp into postcopy_do_resume()
From: |
Daniel P . Berrangé |
Subject: |
[PATCH 33/33] migration: push Error **errp into postcopy_do_resume() |
Date: |
Thu, 4 Feb 2021 17:19:07 +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 | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 32a61b04bf..135a26349f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3163,17 +3163,14 @@ static int postcopy_resume_handshake(MigrationState *s,
Error **errp)
return -1;
}
-/* Return zero if success, or <0 for error */
-static int postcopy_do_resume(MigrationState *s)
+/* Return zero if success, or -1 for error */
+static int postcopy_do_resume(MigrationState *s, Error **errp)
{
- Error *local_err = NULL;
-
/*
* Call all the resume_prepare() hooks, so that modules can be
* ready for the migration resume.
*/
- if (qemu_savevm_state_resume_prepare(s, &local_err) < 0) {
- error_report_err(local_err);
+ if (qemu_savevm_state_resume_prepare(s, errp) < 0) {
return -1;
}
@@ -3181,8 +3178,7 @@ static int postcopy_do_resume(MigrationState *s)
* Last handshake with destination on the resume (destination will
* switch to postcopy-active afterwards)
*/
- if (postcopy_resume_handshake(s, &local_err) < 0) {
- error_report_err(local_err);
+ if (postcopy_resume_handshake(s, errp) < 0) {
return -1;
}
@@ -3196,6 +3192,7 @@ static int postcopy_do_resume(MigrationState *s)
*/
static MigThrError postcopy_pause(MigrationState *s)
{
+ Error *local_err = NULL;
assert(s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE);
while (true) {
@@ -3235,7 +3232,7 @@ static MigThrError postcopy_pause(MigrationState *s)
qemu_sem_post(&s->postcopy_pause_rp_sem);
/* Do the resume logic */
- if (postcopy_do_resume(s) == 0) {
+ if (postcopy_do_resume(s, &local_err) == 0) {
/* Let's continue! */
trace_postcopy_pause_continued();
return MIG_THR_ERR_RECOVERED;
@@ -3245,6 +3242,7 @@ static MigThrError postcopy_pause(MigrationState *s)
* pause again. Pause is always better than throwing
* data away.
*/
+ error_report_err(local_err);
continue;
}
} else {
--
2.29.2
- [PATCH 25/33] migration: push Error **errp into qemu_savevm_state_complete_precopy(), (continued)
- [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é, 2021/02/04
- [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é <=
- Re: [PATCH 00/33] migration: capture error reports into Error object, Dr. David Alan Gilbert, 2021/02/04
- Re: [PATCH 00/33] migration: capture error reports into Error object, Daniel P . Berrangé, 2021/02/04
- Re: [PATCH 00/33] migration: capture error reports into Error object, Dr. David Alan Gilbert, 2021/02/15
- Re: [PATCH 00/33] migration: capture error reports into Error object, Daniel P . Berrangé, 2021/02/15
- Re: [PATCH 00/33] migration: capture error reports into Error object, Dr. David Alan Gilbert, 2021/02/15
- Re: [PATCH 00/33] migration: capture error reports into Error object, Daniel P . Berrangé, 2021/02/16