Re: [PATCH 12/16] Ensure we always read a full buffer in tunnelled migration

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

 



On 05/12/2011 10:04 AM, Daniel P. Berrange wrote:
> The 'nbytes' variable was not re-initialized to the
> buffer size on each iteration of the tunnelled migration
> loop. While saferead() will ensure a full read, except
> on EOF, it is clearer to use the real buffer size
> 
> * src/qemu/qemu_migration.c: Always read full buffer of data
> ---
>  src/qemu/qemu_migration.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 5a149ab..0eefe5c 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -1300,7 +1300,7 @@ static int doTunnelSendAll(virStreamPtr st,
>      }
>  
>      for (;;) {
> -        nbytes = saferead(sock, buffer, nbytes);
> +        nbytes = saferead(sock, buffer, TUNNEL_SEND_BUF_SIZE);
>          if (nbytes < 0) {
>              virReportSystemError(errno, "%s",
>                                   _("tunnelled migration failed to read from qemu"));

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP 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]