[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V4 08/14] migration: refactor migrate_fd_connect failures
From: |
Steve Sistare |
Subject: |
[PATCH V4 08/14] migration: refactor migrate_fd_connect failures |
Date: |
Thu, 22 Feb 2024 09:28:34 -0800 |
Move common code for the error path in migrate_fd_connect to a shared
fail label. No functional change.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
---
migration/migration.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 925103b..6a115d2 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3627,11 +3627,7 @@ void migrate_fd_connect(MigrationState *s, Error
*error_in)
if (migrate_postcopy_ram() || migrate_return_path()) {
if (open_return_path_on_source(s)) {
error_setg(&local_err, "Unable to open return-path for postcopy");
- migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
- migrate_set_error(s, local_err);
- error_report_err(local_err);
- migrate_fd_cleanup(s);
- return;
+ goto fail;
}
}
@@ -3660,6 +3656,13 @@ void migrate_fd_connect(MigrationState *s, Error
*error_in)
migration_thread, s, QEMU_THREAD_JOINABLE);
}
s->migration_thread_running = true;
+ return;
+
+fail:
+ migrate_set_error(s, local_err);
+ migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
+ error_report_err(local_err);
+ migrate_fd_cleanup(s);
}
static void migration_class_init(ObjectClass *klass, void *data)
--
1.8.3.1
- [PATCH V4 00/14] allow cpr-reboot for vfio, Steve Sistare, 2024/02/22
- [PATCH V4 02/14] migration: remove error from notifier data, Steve Sistare, 2024/02/22
- [PATCH V4 01/14] notify: pass error to notifier with return, Steve Sistare, 2024/02/22
- [PATCH V4 03/14] migration: convert to NotifierWithReturn, Steve Sistare, 2024/02/22
- [PATCH V4 04/14] migration: MigrationEvent for notifiers, Steve Sistare, 2024/02/22
- [PATCH V4 05/14] migration: remove postcopy_after_devices, Steve Sistare, 2024/02/22
- [PATCH V4 07/14] migration: per-mode notifiers, Steve Sistare, 2024/02/22
- [PATCH V4 08/14] migration: refactor migrate_fd_connect failures,
Steve Sistare <=
- [PATCH V4 09/14] migration: notifier error checking, Steve Sistare, 2024/02/22
- [PATCH V4 11/14] vfio: register container for cpr, Steve Sistare, 2024/02/22
- [PATCH V4 12/14] vfio: allow cpr-reboot migration if suspended, Steve Sistare, 2024/02/22
- [PATCH V4 13/14] migration: update cpr-reboot description, Steve Sistare, 2024/02/22