From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59134 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdOfY-0002TE-4j for qemu-devel@nongnu.org; Thu, 13 Jan 2011 10:00:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdOfW-0001y6-U9 for qemu-devel@nongnu.org; Thu, 13 Jan 2011 10:00:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdOfW-0001y2-Lt for qemu-devel@nongnu.org; Thu, 13 Jan 2011 10:00:54 -0500 From: Amit Shah Date: Thu, 13 Jan 2011 20:30:37 +0530 Message-Id: Subject: [Qemu-devel] [PATCH v2 0/5] iohandlers: Add support for enabling/disabling individual handlers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , Gerd Hoffmann , Paul Brook Hi, This patchset adds new interfaces to work with iohandlers. It adds: int assign_fd_handlers(int fd, IOHandlerOps *ops, void *opaque) -- Specify io handlers for an fd int remove_fd_handlers(int fd) -- Remove fd handlers for fd (mark ioh for deletion) int set_read_poll_fd_action(int fd, bool enable) -- Enable or disable the fd_read_poll fd handler int set_read_fd_action(int fd, bool enable) -- Enable or disable the fd_read fd handler int set_write_fd_action(int fd, bool enable) -- Enable or disable the fd_read fd handler A new struct, IOHandlerOps, is added, to collect all the ops together instead of passing individual ones to functions. The older function, qemu_set_fd_handler2(), is now a wrapper to assign_fd_handlers() and can be deprecated by converting the existing usage to assign_fd_handlers(). v2: Address comments from Gerd: - add comments to new interfaces - enable all specified handlers by default in assign_fd_handlers() - Add comments for TODO items on deprecation of older interfaces. Please apply. Amit Shah (5): iohandlers: Avoid code duplication iohandlers: Introduce assign_fd_handlers() and remove_fd_handlers iohandlers: Allow each iohandler to be enabled/disabled individually iohandlers: Enable an iohandler only if the associated handler exists iohandlers: Add IOHandlerOps struct qemu-char.h | 7 ++ vl.c | 197 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 170 insertions(+), 34 deletions(-) -- 1.7.3.4