From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHTKx-0003qG-V0 for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:55:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHTKr-0001Ja-AJ for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:55:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHTKq-0001JH-RX for qemu-devel@nongnu.org; Tue, 21 Jul 2015 04:55:36 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 6EE22DB2 for ; Tue, 21 Jul 2015 08:55:36 +0000 (UTC) References: <1437464069-27508-1-git-send-email-pbonzini@redhat.com> <55AE081F.4060702@redhat.com> From: Paolo Bonzini Message-ID: <55AE0903.9090803@redhat.com> Date: Tue, 21 Jul 2015 10:55:31 +0200 MIME-Version: 1.0 In-Reply-To: <55AE081F.4060702@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: Thomas Huth , qemu-devel@nongnu.org Cc: amit.shah@redhat.com On 21/07/2015 10:51, Thomas Huth wrote: > 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) Interesting macro. :) I wonder why it's being used only for open (and qemu_open), though. Paolo