
On Wed, Jun 01, 2022 at 14:50:06 +0200, Jiri Denemark wrote:
The QEMU process is already running, all we need to do is to call migrate-recover QMP command. Except for some checks and cookie handling, of course.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> ---
Notes: Version 2: - no change
src/qemu/qemu_migration.c | 99 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+)
And the following diff is needed to make sure the Finish phase sees the original name of the domain in case it was renamed during migration (via --dname ... option). Jirka diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 22a80d8430..506b6cde7a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3534,6 +3534,8 @@ qemuMigrationDstPrepareResume(virQEMUDriver *driver, QEMU_MIGRATION_COOKIE_CAPS))) goto cleanup; + priv->origname = g_strdup(origname); + if (!(incoming = qemuMigrationDstPrepare(vm, false, protocol, listenAddress, port, -1))) goto cleanup; @@ -3561,8 +3563,10 @@ qemuMigrationDstPrepareResume(virQEMUDriver *driver, cleanup: qemuProcessIncomingDefFree(incoming); - if (ret < 0) + if (ret < 0) { + VIR_FREE(priv->origname); ignore_value(qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_POSTCOPY_FAILED)); + } qemuDomainCleanupAdd(vm, qemuProcessCleanupMigrationJob); qemuMigrationJobContinue(vm); virDomainObjEndAPI(&vm);