From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqgVu-00007Z-O2 for qemu-devel@nongnu.org; Fri, 08 May 2015 07:32:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqgVs-0000k9-1n for qemu-devel@nongnu.org; Fri, 08 May 2015 07:32:18 -0400 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:33993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqgVr-0000jy-Rl for qemu-devel@nongnu.org; Fri, 08 May 2015 07:32:15 -0400 Received: by wgic8 with SMTP id c8so43208865wgi.1 for ; Fri, 08 May 2015 04:32:15 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <554C9EBB.6050600@redhat.com> Date: Fri, 08 May 2015 13:32:11 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <554C9D0B.205@redhat.com> In-Reply-To: <554C9D0B.205@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] eventfd_signal() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Catalin Vasile , qemu-devel@nongnu.org On 08/05/2015 13:24, Paolo Bonzini wrote: > > > On 08/05/2015 12:58, Catalin Vasile wrote: >> Is eventfd blocking? By that I mean: If I signal the guest for >> something, will that thread remain blocked till the guest clears the >> interrupt? > > No. If you want that, write 2^64-2 to the eventfd and do a > > pfd.fd = ... > pfd.events = POLLOUT; > poll(&pfd, 1, -1); > > after the write. > > With this algorithm, a write will fail with EINVAL if there is already > another pending write somewhere. The "poll" will still work after the > failed write. Oops, EAGAIN... Paolo