mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 05:35:39 +00:00
migration: Remove qmp_migrate_finish
After cleanups, the qmp_migrate_finish function is now just a call to migration_connect_outgoing(). Remove qmp_migrate_finish() and rename the qmp_migrate_finish_cb callback. This also allows the function's error handling to be removed as it now receives &local_err like the rest of the callees of qmp_migrate(). Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Prasad Pandit <pjp@fedoraproject.org> Link: https://lore.kernel.org/qemu-devel/20260123141656.6765-25-farosas@suse.de Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
@@ -1998,15 +1998,18 @@ static bool migrate_prepare(MigrationState *s, bool resume, Error **errp)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void qmp_migrate_finish(MigrationAddress *addr, Error **errp);
|
||||
|
||||
static gboolean qmp_migrate_finish_cb(QIOChannel *channel,
|
||||
GIOCondition cond,
|
||||
void *opaque)
|
||||
static gboolean migration_connect_outgoing_cb(QIOChannel *channel,
|
||||
GIOCondition cond, void *opaque)
|
||||
{
|
||||
MigrationAddress *addr = opaque;
|
||||
MigrationState *s = migrate_get_current();
|
||||
Error *local_err = NULL;
|
||||
|
||||
migration_connect_outgoing(s, opaque, &local_err);
|
||||
|
||||
if (local_err) {
|
||||
migration_connect_error_propagate(s, local_err);
|
||||
}
|
||||
|
||||
qmp_migrate_finish(addr, NULL);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@@ -2055,10 +2058,11 @@ void qmp_migrate(const char *uri, bool has_channels,
|
||||
* connection, so qmp_migrate_finish will fail to connect, and then recover.
|
||||
*/
|
||||
if (migrate_mode() == MIG_MODE_CPR_TRANSFER) {
|
||||
cpr_transfer_add_hup_watch(s, qmp_migrate_finish_cb, main_ch->addr);
|
||||
cpr_transfer_add_hup_watch(s, migration_connect_outgoing_cb,
|
||||
main_ch->addr);
|
||||
|
||||
} else {
|
||||
qmp_migrate_finish(main_ch->addr, errp);
|
||||
migration_connect_outgoing(s, main_ch->addr, &local_err);
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -2068,19 +2072,6 @@ out:
|
||||
}
|
||||
}
|
||||
|
||||
static void qmp_migrate_finish(MigrationAddress *addr, Error **errp)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
Error *local_err = NULL;
|
||||
|
||||
migration_connect_outgoing(s, addr, &local_err);
|
||||
|
||||
if (local_err) {
|
||||
migration_connect_error_propagate(s, error_copy(local_err));
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
}
|
||||
|
||||
void qmp_migrate_cancel(Error **errp)
|
||||
{
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user