[libvirt] [PATCH] qemu: Update balloon state after migration finishes

Michal Privoznik mprivozn at redhat.com
Mon Sep 21 12:23:05 UTC 2015


On 21.09.2015 13:43, Peter Krempa wrote:
> Since qemu doesn't know at the beginning of migration what the actual
> balloon size is until the migration stream transfers the appropriate
> fields we also need to update the balloon size unconditionally in the
> finish phase of the migration.
> ---

Okay, I did not understand this at first glance, but my later discussion
with Peter showed, that if we have the balloon event, we no longer use
monitor command to update the balloon size when needed. Therefore we
must refresh it upon successful migration. Mind mentioning that in the
commit message?

>  src/qemu/qemu_migration.c | 4 ++++
>  src/qemu/qemu_process.c   | 2 +-
>  src/qemu/qemu_process.h   | 4 ++++
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 903612b..38649ed 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -5701,6 +5701,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
>          if (qemuMigrationStopNBDServer(driver, vm, mig) < 0)
>              goto endjob;
> 
> +        if (qemuProcessRefreshBalloonState(driver, vm,
> +                                           QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
> +            goto endjob;
> +
>          if (flags & VIR_MIGRATE_PERSIST_DEST) {
>              if (qemuMigrationPersist(driver, vm, mig, !v3proto) < 0) {
>                  /* Hmpf.  Migration was successful, but making it persistent
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 7187dc1..f14582b 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -2091,7 +2091,7 @@ qemuProcessReconnectRefreshChannelVirtioState(virQEMUDriverPtr driver,
>  }
> 
> 
> -static int
> +int
>  qemuProcessRefreshBalloonState(virQEMUDriverPtr driver,
>                                 virDomainObjPtr vm,
>                                 int asyncJob)
> diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
> index d40f68d..b198c2b 100644
> --- a/src/qemu/qemu_process.h
> +++ b/src/qemu/qemu_process.h
> @@ -115,4 +115,8 @@ virDomainDiskDefPtr qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm,
> 
>  int qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm);
> 
> +int qemuProcessRefreshBalloonState(virQEMUDriverPtr driver,
> +                                   virDomainObjPtr vm,
> +                                   int asyncJob);
> +
>  #endif /* __QEMU_PROCESS_H__ */
> 

ACK

Michal




More information about the libvir-list mailing list