On Tue, May 10, 2022 at 17:20:36 +0200, Jiri Denemark wrote:
> When migration fails after it already switched to post-copy phase on the
> source, but early enough that we haven't called Finish on the
> destination yet, we know the vCPUs were not started on the destination
> and the source host still has a complete state of the domain. Thus we
> can just ignore the fact post-copy phase started and normally abort the
> migration and resume vCPUs on the source.
> 
> Signed-off-by: Jiri Denemark <jdene...@redhat.com>
> ---
>  src/qemu/qemu_migration.c |  9 +++++++++
>  src/qemu/qemu_process.c   | 20 ++++++++------------
>  2 files changed, 17 insertions(+), 12 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 532a9300b6..e892a09885 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -4442,6 +4442,15 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
>      virErrorPreserveLast(&orig_err);
>  
>      if (virDomainObjIsActive(vm)) {
> +        int reason;
> +        virDomainState state = virDomainObjGetState(vm, &reason);
> +
> +        if (state == VIR_DOMAIN_PAUSED && reason == 
> VIR_DOMAIN_PAUSED_POSTCOPY) {
> +            VIR_DEBUG("Aborting failed post-copy migration as the 
> destination "
> +                      "is not running yet");

Preferrably no linebreaks in new diagnostic strings.


Reviewed-by: Peter Krempa <pkre...@redhat.com>

Reply via email to