[libvirt PATCH 35/80] qemu: Introduce qemuMigrationDstFinishActive

Peter Krempa pkrempa at redhat.com
Wed May 11 15:01:52 UTC 2022


On Tue, May 10, 2022 at 17:20:56 +0200, Jiri Denemark wrote:
> Refactors qemuMigrationDstFinish by moving some parts to a dedicated
> function for easier introduction of postcopy resume code without
> duplicating common parts of the Finish phase. The goal is to have the
> following call graph:
> 
>     - qemuMigrationDstFinish
>         - qemuMigrationDstFinishOffline
>         - qemuMigrationDstFinishActive
>             - qemuMigrationDstFinishFresh
>             - qemuMigrationDstFinishResume
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  src/qemu/qemu_migration.c | 173 +++++++++++++++++++++++---------------
>  1 file changed, 103 insertions(+), 70 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 170d99d789..d02e8132e4 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -6004,71 +6004,32 @@ qemuMigrationDstFinishFresh(virQEMUDriver *driver,
>  }
>  
>  
> -virDomainPtr
> -qemuMigrationDstFinish(virQEMUDriver *driver,
> -                       virConnectPtr dconn,
> -                       virDomainObj *vm,
> -                       const char *cookiein,
> -                       int cookieinlen,
> -                       char **cookieout,
> -                       int *cookieoutlen,
> -                       unsigned long flags,
> -                       int retcode,
> -                       bool v3proto)
> +static virDomainPtr
> +qemuMigrationDstFinishActive(virQEMUDriver *driver,
> +                             virConnectPtr dconn,
> +                             virDomainObj *vm,
> +                             int cookie_flags,
> +                             const char *cookiein,
> +                             int cookieinlen,
> +                             char **cookieout,
> +                             int *cookieoutlen,
> +                             unsigned long flags,
> +                             int retcode,
> +                             bool v3proto,
> +                             unsigned long long timeReceived,
> +                             virErrorPtr *orig_err)

The argument list is getting a bit riddiculous. Especially weird is that
you pass 'orig_err' in. The only error that could overwrite it is from
virPortAllocatorRelease and that one IMNSHO should not report any
errrors or at least have a quiet version.

Please don't pass the error out, but re-set it and deal with the caller
separately.

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


More information about the libvir-list mailing list