From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6Jvv-0000ul-MV for qemu-devel@nongnu.org; Mon, 05 Aug 2013 08:30:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6Jvq-0003f4-1S for qemu-devel@nongnu.org; Mon, 05 Aug 2013 08:30:43 -0400 Date: Mon, 5 Aug 2013 14:30:14 +0200 From: Kevin Wolf Message-ID: <20130805123014.GH2654@dhcp-200-207.str.redhat.com> References: <1374568221-23147-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> <1374568221-23147-3-git-send-email-morita.kazutaka@lab.ntt.co.jp> <51EE68D1.9090102@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 02/11] iov: handle EOF in iov_send_recv List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Doug Goldstein Cc: Stefan Hajnoczi , sheepdog@lists.wpkg.org, qemu-devel , MORITA Kazutaka , qemu-stable@nongnu.org Am 03.08.2013 um 05:48 hat Doug Goldstein geschrieben: > On Tue, Jul 23, 2013 at 6:28 AM, Paolo Bonzini wrote: > > Il 23/07/2013 10:30, MORITA Kazutaka ha scritto: > >> Without this patch, iov_send_recv() never returns when do_send_recv() > >> returns zero. > >> > >> Signed-off-by: MORITA Kazutaka > >> --- > >> util/iov.c | 6 ++++++ > >> 1 file changed, 6 insertions(+) > >> > >> diff --git a/util/iov.c b/util/iov.c > >> index cc6e837..f705586 100644 > >> --- a/util/iov.c > >> +++ b/util/iov.c > >> @@ -202,6 +202,12 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt, > >> return -1; > >> } > >> > >> + if (ret == 0 && !do_send) { > >> + /* recv returns 0 when the peer has performed an orderly > >> + * shutdown. */ > >> + break; > >> + } > >> + > >> /* Prepare for the next iteration */ > >> offset += ret; > >> total += ret; > >> > > > > Reviewed-by: Paolo Bonzini > > > > ... and should also be in 1.5.2. > > > > Paolo > > > > Nudge so this doesn't get forgotten about. It hasn't hit master yet. Thanks, applied to the block branch. Kevin