mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00:00
qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Confirm phase
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
f2a19b4cd0
commit
491c9eff6c
@ -3777,15 +3777,19 @@ qemuMigrationSrcConfirmPhase(virQEMUDriver *driver,
|
|||||||
|
|
||||||
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
|
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
|
||||||
|
|
||||||
/* Keep the original migration phase in case post-copy failed as the job
|
if (flags & VIR_MIGRATE_POSTCOPY_RESUME) {
|
||||||
* will stay active even though migration API finishes with an error.
|
phase = QEMU_MIGRATION_PHASE_CONFIRM_RESUME;
|
||||||
|
} else if (virDomainObjIsFailedPostcopy(vm)) {
|
||||||
|
/* Keep the original migration phase in case post-copy failed as the
|
||||||
|
* job will stay active even though migration API finishes with an
|
||||||
|
* error.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjIsFailedPostcopy(vm))
|
|
||||||
phase = priv->job.phase;
|
phase = priv->job.phase;
|
||||||
else if (retcode == 0)
|
} else if (retcode == 0) {
|
||||||
phase = QEMU_MIGRATION_PHASE_CONFIRM3;
|
phase = QEMU_MIGRATION_PHASE_CONFIRM3;
|
||||||
else
|
} else {
|
||||||
phase = QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED;
|
phase = QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
if (qemuMigrationJobStartPhase(vm, phase) < 0)
|
if (qemuMigrationJobStartPhase(vm, phase) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -3860,11 +3864,20 @@ qemuMigrationSrcConfirm(virQEMUDriver *driver,
|
|||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
VIR_DEBUG("vm=%p, flags=0x%x, cancelled=%d", vm, flags, cancelled);
|
||||||
|
|
||||||
|
if (flags & VIR_MIGRATE_POSTCOPY_RESUME) {
|
||||||
|
if (!qemuMigrationAnyCanResume(vm, VIR_ASYNC_JOB_MIGRATION_OUT, flags,
|
||||||
|
QEMU_MIGRATION_PHASE_PERFORM_RESUME))
|
||||||
|
goto cleanup;
|
||||||
|
phase = QEMU_MIGRATION_PHASE_CONFIRM_RESUME;
|
||||||
|
} else {
|
||||||
if (!qemuMigrationJobIsActive(vm, VIR_ASYNC_JOB_MIGRATION_OUT))
|
if (!qemuMigrationJobIsActive(vm, VIR_ASYNC_JOB_MIGRATION_OUT))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Keep the original migration phase in case post-copy failed as the job
|
/* Keep the original migration phase in case post-copy failed as the
|
||||||
* will stay active even though migration API finishes with an error.
|
* job will stay active even though migration API finishes with an
|
||||||
|
* error.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjIsFailedPostcopy(vm))
|
if (virDomainObjIsFailedPostcopy(vm))
|
||||||
phase = priv->job.phase;
|
phase = priv->job.phase;
|
||||||
@ -3872,6 +3885,7 @@ qemuMigrationSrcConfirm(virQEMUDriver *driver,
|
|||||||
phase = QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED;
|
phase = QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED;
|
||||||
else
|
else
|
||||||
phase = QEMU_MIGRATION_PHASE_CONFIRM3;
|
phase = QEMU_MIGRATION_PHASE_CONFIRM3;
|
||||||
|
}
|
||||||
|
|
||||||
if (qemuMigrationJobStartPhase(vm, phase) < 0)
|
if (qemuMigrationJobStartPhase(vm, phase) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user