Ensure we always read a full buffer in tunnelled migration

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
This commit is contained in:
Daniel P. Berrange 2011-04-21 17:13:56 +01:00
parent dba5a60462
commit 74f332468d

View File

@ -1300,7 +1300,7 @@ static int doTunnelSendAll(virStreamPtr st,
} }
for (;;) { for (;;) {
nbytes = saferead(sock, buffer, nbytes); nbytes = saferead(sock, buffer, TUNNEL_SEND_BUF_SIZE);
if (nbytes < 0) { if (nbytes < 0) {
virReportSystemError(errno, "%s", virReportSystemError(errno, "%s",
_("tunnelled migration failed to read from qemu")); _("tunnelled migration failed to read from qemu"));