qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 2/5] char: Introduce char_set/remove_fd_handlers


From: Gerd Hoffmann
Subject: [Qemu-devel] Re: [PATCH 2/5] char: Introduce char_set/remove_fd_handlers()
Date: Tue, 11 Jan 2011 16:54:48 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Red Hat/3.1.7-3.el6_0 Thunderbird/3.1.7

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]