Re: [libvirt PATCH 15/80] qemu: Abort failed post-copy when we haven't called Finish yet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jdenemar@xxxxxxxxxx>
> ---
>  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 <pkrempa@xxxxxxxxxx>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux