From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9Cnz-0000z0-VE for qemu-devel@nongnu.org; Tue, 04 May 2010 03:44:36 -0400 Received: from [140.186.70.92] (port=58482 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9CnA-0000q3-5L for qemu-devel@nongnu.org; Tue, 04 May 2010 03:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9Cml-0005uc-TS for qemu-devel@nongnu.org; Tue, 04 May 2010 03:43:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33094) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9Cml-0005u4-Cu for qemu-devel@nongnu.org; Tue, 04 May 2010 03:43:19 -0400 Message-ID: <4BDFD008.3000106@redhat.com> Date: Tue, 04 May 2010 09:43:04 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1272957442-7832-1-git-send-email-amit.shah@redhat.com> <1272957442-7832-2-git-send-email-amit.shah@redhat.com> <1272957442-7832-3-git-send-email-amit.shah@redhat.com> <1272957442-7832-4-git-send-email-amit.shah@redhat.com> In-Reply-To: <1272957442-7832-4-git-send-email-amit.shah@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v4 3/5] char: unix/tcp: Add a non-blocking write handler List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Paul Brook , qemu list , Juan Quintela On 05/04/10 09:17, Amit Shah wrote: > Add a non-blocking write handler that can return with -EAGAIN to the > caller and also callback when the socket becomes writable. > > Non-blocking writes are only enabled for sockets that are opened in > non-blocking mode and only for callers that have registered a callback > handler for resuming writes. The logic will be pretty much the same for all filehandle-based backends on unix. So maybe create some helper functions, so implementing $backend_chr_write_unblocked can be done with just three lines of code? cheers, Gerd