qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 22/33] migration: remove the QEMUFileOps 'get_buffer' callback


From: Peter Xu
Subject: Re: [PULL 22/33] migration: remove the QEMUFileOps 'get_buffer' callback
Date: Wed, 22 Jun 2022 15:34:52 -0400

On Wed, Jun 22, 2022 at 07:39:06PM +0100, Dr. David Alan Gilbert (git) wrote:
> diff --git a/migration/qemu-file.c b/migration/qemu-file.c
> index 74f919de67..e206b05550 100644
> --- a/migration/qemu-file.c
> +++ b/migration/qemu-file.c
> @@ -377,8 +377,22 @@ static ssize_t qemu_fill_buffer(QEMUFile *f)
>          return 0;
>      }
>  
> -    len = f->ops->get_buffer(f->ioc, f->buf + pending, f->total_transferred,
> -                             IO_BUF_SIZE - pending, &local_error);
> +    do {
> +        len = qio_channel_read(f->ioc,
> +                               (char *)f->buf + pending,
> +                               IO_BUF_SIZE - pending,
> +                               &local_error);
> +        if (len == QIO_CHANNEL_ERR_BLOCK) {
> +            if (qemu_in_coroutine()) {
> +                qio_channel_yield(f->ioc, G_IO_IN);
> +            } else {
> +                qio_channel_wait(f->ioc, G_IO_IN);
> +            }
> +        } else if (len < 0) {
> +            len = EIO;

This should be -EIO.

> +        }
> +    } while (len == QIO_CHANNEL_ERR_BLOCK);

It's failing only with the new TLS test I added for postcopy somehow (at
least /x86_64/migration/postcopy/recovery/tls).. I also verified after the
change it'll work again.

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]