From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57893 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcgYn-00033c-AU for qemu-devel@nongnu.org; Tue, 11 Jan 2011 10:55:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcgYl-0003mR-VY for qemu-devel@nongnu.org; Tue, 11 Jan 2011 10:55:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcgYl-0003m7-OH for qemu-devel@nongnu.org; Tue, 11 Jan 2011 10:54:59 -0500 Message-ID: <4D2C7D48.6060000@redhat.com> Date: Tue, 11 Jan 2011 16:54:48 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <0f9330ee99fb9d11639a98d5fb9c01625a15822e.1294743490.git.amit.shah@redhat.com> <4D2C6BB2.206@redhat.com> <20110111153818.GA4092@amit-x200.redhat.com> In-Reply-To: <20110111153818.GA4092@amit-x200.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 2/5] char: Introduce char_set/remove_fd_handlers() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list , Paul Brook On 01/11/11 16:38, Amit Shah wrote: > On (Tue) Jan 11 2011 [15:39:46], Gerd Hoffmann wrote: >> On 01/11/11 12:10, Amit Shah wrote: >>> Introduce a char-specific wrapper to qemu_set_fd_handler functions. >>> This wrapper is useful to add / remove a write handler easily. Write >>> handlers are only used when the backend is blocked and cannot receive >>> any more input. >> >> I'd suggest to add flags to enable/disable handlers to >> IOHandlerRecord instead. And helper functions to set/clear them of >> course. >> >> With that in place you also can move the handlers to a separate >> struct simliar to the new QemuChrHandlers struct from patch #1. > > I'm planning to do that later -- when more backends get involved, which > have multiple fds (one for in, one for out). Moving the handlers to a separate struct is clearly a incremental cleanup which can follow later. Using enable/disable flags will probably simplify the interfaces for the non-blocking mode and thus simplify the whole patch series so I think this should be done now. cheers, Gerd