On Fri, Feb 07, 2025 at 11:27:54AM -0300, Fabiano Rosas wrote:
> We're currently only checking the QEMUFile error after
> qemu_loadvm_state(). Check the migration error as well to avoid
> missing errors that might be set by the multifd recv thread.
> 
> This doesn't break compat between 9.2 and 10.0 because 9.2 still has
> the multifd recv threads stuck at sync when the source channel shuts
> down. I.e. it doesn't have commit 1d457daf86 ("migration/multifd:
> Further remove the SYNC on complete"). QEMU versions with that commit
> will have compat broken with versions containing this commit. This is
> not an issue because both will be present in 10.0, but development
> trees might see a migration error.
> 
> Signed-off-by: Fabiano Rosas <faro...@suse.de>
> ---
>  migration/savevm.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index bc375db282..4046faf009 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -2940,7 +2940,11 @@ int qemu_loadvm_state(QEMUFile *f)
>  
>      /* When reaching here, it must be precopy */
>      if (ret == 0) {
> -        ret = qemu_file_get_error(f);
> +        if (migrate_has_error(migrate_get_current())) {
> +            ret = -EINVAL;
> +        } else {
> +            ret = qemu_file_get_error(f);
> +        }
>      }

IIUC this one needs to be after the patch that allows pre-mature
terminations from old qemus?

-- 
Peter Xu


Reply via email to