From 74f332468dad3c4926a68fc41c93a4efb10b7233 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 21 Apr 2011 17:13:56 +0100 Subject: [PATCH] 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 --- src/qemu/qemu_migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 12486f5145..b132d860cd 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"));