From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHTHD-0000ZW-E6 for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHTH9-00089X-Aw for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:51:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHTH9-00089R-5i for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:51:47 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 752DB49 for ; Tue, 21 Jul 2015 08:51:46 +0000 (UTC) Message-ID: <55AE081F.4060702@redhat.com> Date: Tue, 21 Jul 2015 10:51:43 +0200 From: Thomas Huth MIME-Version: 1.0 References: <1437464069-27508-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1437464069-27508-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-char: handle EINTR for TCP character devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: amit.shah@redhat.com On 21/07/15 09:34, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > qemu-char.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/qemu-char.c b/qemu-char.c > index b2b43c5..d956f8d 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -2798,7 +2798,10 @@ static ssize_t tcp_chr_recv(CharDriverState *chr, char *buf, size_t len) > #ifdef MSG_CMSG_CLOEXEC > flags |= MSG_CMSG_CLOEXEC; > #endif > - ret = recvmsg(s->fd, &msg, flags); > + do { > + ret = recvmsg(s->fd, &msg, flags); > + } while (ret == -1 && errno == EINTR); > + > if (ret > 0 && s->is_unix) { > unix_process_msgfd(chr, &msg); > } I think you could also use the TFR() macro from include/qemu-common.h here instead (TFR = temp. failure retry, I think) Thomas