Re: [PATCH 4/7] qemu: Kill domain when migration finish fails

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

 



On Wed, Jul 08, 2015 at 19:36:03 +0200, Jiri Denemark wrote:
> Whenever something fails during incoming migration in Finish phase
> before we started guest CPUs, we need to kill the domain in addition to
> reporting the failure.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_migration.c | 32 ++++++++++++--------------------
>  1 file changed, 12 insertions(+), 20 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 9439954..576b32d 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -5589,6 +5589,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
>      qemuDomainObjPrivatePtr priv = vm->privateData;
>      virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
>      unsigned short port;
> +    bool keep = false;
>  
>      VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
>                "cookieout=%p, cookieoutlen=%p, flags=%lx, retcode=%d",
> @@ -5647,15 +5648,9 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
>              }
>          }
>  
> -        if (qemuMigrationVPAssociatePortProfiles(vm->def) < 0) {
> -            qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,
> -                            VIR_QEMU_PROCESS_STOP_MIGRATED);
> -            virDomainAuditStop(vm, "failed");
> -            event = virDomainEventLifecycleNewFromObj(vm,
> -                                             VIR_DOMAIN_EVENT_STOPPED,
> -                                             VIR_DOMAIN_EVENT_STOPPED_FAILED);
> +        if (qemuMigrationVPAssociatePortProfiles(vm->def) < 0)
>              goto endjob;
> -        }
> +
>          if (mig->network && qemuDomainMigrateOPDRelocate(driver, vm, mig) < 0)
>              VIR_WARN("unable to provide network data for relocation");
>  
> @@ -5681,11 +5676,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
>                   * to restart during confirm() step, so we kill it off now.
>                   */
>                  if (v3proto) {
> -                    qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,
> -                                    VIR_QEMU_PROCESS_STOP_MIGRATED);
> -                    virDomainAuditStop(vm, "failed");
>                      if (newVM)
>                          vm->persistent = 0;

If you choose to fix qemuMigrationPersist so that it sets the persistent
flag only on succes to fix the previous patch then this will create a
conflict since the above statement shouldn't be necessary.

> +                } else {
> +                    keep = true;
>                  }
>                  goto endjob;
>              }

ACK,

Peter

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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]