mirror of https://github.com/proxmox/mirror_qemu
migration: Allow migrate-recover to run multiple times
Previously migration didn't have an easy way to cleanup the listening transport, migrate recovery only allows to execute once. That's done with a trick flag in postcopy_recover_triggered. Now the facility is already there. Drop postcopy_recover_triggered and instead allows a new migrate-recover to release the previous listener transport. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20220331150857.74406-8-peterx@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>master
parent
a39e933962
commit
08401c0426
|
@ -2162,11 +2162,8 @@ void qmp_migrate_recover(const char *uri, Error **errp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qatomic_cmpxchg(&mis->postcopy_recover_triggered,
|
/* If there's an existing transport, release it */
|
||||||
false, true) == true) {
|
migration_incoming_transport_cleanup(mis);
|
||||||
error_setg(errp, "Migrate recovery is triggered already");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note that this call will never start a real migration; it will
|
* Note that this call will never start a real migration; it will
|
||||||
|
@ -2174,12 +2171,6 @@ void qmp_migrate_recover(const char *uri, Error **errp)
|
||||||
* to continue using that newly established channel.
|
* to continue using that newly established channel.
|
||||||
*/
|
*/
|
||||||
qemu_start_incoming_migration(uri, errp);
|
qemu_start_incoming_migration(uri, errp);
|
||||||
|
|
||||||
/* Safe to dereference with the assert above */
|
|
||||||
if (*errp) {
|
|
||||||
/* Reset the flag so user could still retry */
|
|
||||||
qatomic_set(&mis->postcopy_recover_triggered, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_migrate_pause(Error **errp)
|
void qmp_migrate_pause(Error **errp)
|
||||||
|
|
|
@ -139,7 +139,6 @@ struct MigrationIncomingState {
|
||||||
struct PostcopyBlocktimeContext *blocktime_ctx;
|
struct PostcopyBlocktimeContext *blocktime_ctx;
|
||||||
|
|
||||||
/* notify PAUSED postcopy incoming migrations to try to continue */
|
/* notify PAUSED postcopy incoming migrations to try to continue */
|
||||||
bool postcopy_recover_triggered;
|
|
||||||
QemuSemaphore postcopy_pause_sem_dst;
|
QemuSemaphore postcopy_pause_sem_dst;
|
||||||
QemuSemaphore postcopy_pause_sem_fault;
|
QemuSemaphore postcopy_pause_sem_fault;
|
||||||
|
|
||||||
|
|
|
@ -2589,9 +2589,6 @@ static bool postcopy_pause_incoming(MigrationIncomingState *mis)
|
||||||
|
|
||||||
assert(migrate_postcopy_ram());
|
assert(migrate_postcopy_ram());
|
||||||
|
|
||||||
/* Clear the triggered bit to allow one recovery */
|
|
||||||
mis->postcopy_recover_triggered = false;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unregister yank with either from/to src would work, since ioc behind it
|
* Unregister yank with either from/to src would work, since ioc behind it
|
||||||
* is the same
|
* is the same
|
||||||
|
|
Loading…
Reference in New Issue