[libvirt PATCH v2 20/81] qemu: Handle 'postcopy-paused' migration state

Peter Krempa pkrempa at redhat.com
Mon Jun 6 12:44:39 UTC 2022


On Wed, Jun 01, 2022 at 14:49:20 +0200, Jiri Denemark wrote:
> When connection breaks during post-copy migration, QEMU enters
> 'postcopy-paused' state. We need to handle this state and make the
> situation visible to upper layers.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
> 
> Notes:
>     Version 2:
>     - rebased on top of newly added "qemu: Use switch in
>       qemuProcessHandleMigrationStatus"
> 
>  src/hypervisor/domain_job.c  |  1 +
>  src/hypervisor/domain_job.h  |  1 +
>  src/qemu/qemu_driver.c       |  1 +
>  src/qemu/qemu_migration.c    | 11 +++++++++++
>  src/qemu/qemu_monitor.c      |  1 +
>  src/qemu/qemu_monitor.h      |  1 +
>  src/qemu/qemu_monitor_json.c |  1 +
>  src/qemu/qemu_process.c      | 11 +++++++++++
>  8 files changed, 28 insertions(+)

[...]

> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index f81d1e65ff..de4be0e7f9 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c

[...]

> @@ -1871,6 +1875,12 @@ qemuMigrationJobCheckStatus(virQEMUDriver *driver,
>                         qemuMigrationJobName(vm), _("canceled by client"));
>          return -1;
>  
> +    case VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED:
> +        virReportError(VIR_ERR_OPERATION_FAILED, _("%s: %s"),
> +                       qemuMigrationJobName(vm),
> +                       _("post-copy phase failed"));
> +        return -1;

This error message is so broken I had the urge to complain about it
again, but then noticed that I already did and also noted to refactor
all of this awfullness.

> +
>      case VIR_DOMAIN_JOB_STATUS_COMPLETED:
>      case VIR_DOMAIN_JOB_STATUS_ACTIVE:
>      case VIR_DOMAIN_JOB_STATUS_MIGRATING:

Reviewed-by: Peter Krempa <pkrempa at redhat.com>


More information about the libvir-list mailing list