From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Np8dr-0001zh-LO for qemu-devel@nongnu.org; Tue, 09 Mar 2010 18:15:11 -0500 Received: from [199.232.76.173] (port=54440 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Np8dr-0001ys-0Z for qemu-devel@nongnu.org; Tue, 09 Mar 2010 18:15:11 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Np8dp-0006ek-I2 for qemu-devel@nongnu.org; Tue, 09 Mar 2010 18:15:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34319) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Np8dp-0006eb-3o for qemu-devel@nongnu.org; Tue, 09 Mar 2010 18:15:09 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o29MQ5iv006018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Mar 2010 17:26:06 -0500 From: Juan Quintela Date: Tue, 9 Mar 2010 23:25:54 +0100 Message-Id: Subject: [Qemu-devel] [PATCH 0/9] Clear fd handlers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi This series : - convert io_handlers to one QLIST - once there, qemu_set_fd_handlers2() has lots of arguments that are a lot of times NULL. Introduce a set of functions to not have to pass NULL values. - qemu_clear_fd_handlers(): remove it - qemu_set_fd_read_handler(): only read - qemu_set_fd_write_handler(): only write - qemu_set_fd_rw_handler(): read/write - qemu_set_fd_poll_handler(): it was only used for reads and in qemu-char.c. - once there fix bt that don't need poll at all (having a poll function that always return true is the equivalent of not having one). - remove cast to (void *)(unsigned long) for things that already were pointers - IOCanRWHandler is only used for reads -> rename it (almost no users). ToDo: - to remove the export of qemu_set_fd_handlers2() we need a solution for tap. Tap is the only user in qemu that uses poll, read and write, and it changes in very imaginative ways: qemu_set_fd_handler2(s->fd, s->read_poll ? tap_can_send : NULL, s->read_poll ? tap_send : NULL, s->write_poll ? tap_writable : NULL, s); No ideas about how to transform this into something that don't use NULL's in any of its fields other than a row of if's. - removal of poll function. comment of qemu_set_fd_handler2() /* XXX: fd_read_poll should be suppressed, but an API change is necessary in the character devices to suppress fd_can_read(). */ But qemu-char.c is a complex beast, and would preffer to 1st get this patches in, and then work on the other stuff. - obvious optimization now is to have the FD_SET() for write/read already filled, but I haven't done any meassurement. Comments? Juan Quintela (9): Convert io handlers to QLIST Introduce qemu_clear_fd_handler() Introduce qemu_set_fd_read_handler() Introduce qemu_set_fd_write_handler() Introduce qemu_set_fd_rw_handler() bt: remove bt_host_read_poll() Introduce qemu_set_fd_poll_handler() remove useless cast rename IOCanRWHandler to IOCanReadHandler aio.c | 2 +- audio/alsaaudio.c | 12 +++--- audio/ossaudio.c | 10 ++-- bt-host.c | 9 +---- bt-vhci.c | 2 +- hw/baum.c | 2 +- hw/xen_backend.c | 10 ++-- migration-exec.c | 8 ++-- migration-fd.c | 5 +- migration-tcp.c | 10 ++-- migration-unix.c | 10 ++-- migration.c | 8 ++-- net/socket.c | 14 +++--- net/vde.c | 4 +- qemu-aio.h | 4 +- qemu-char.c | 48 +++++++++++----------- qemu-char.h | 25 ++++++++--- qemu-common.h | 2 +- qemu-tool.c | 9 ++-- usb-linux.c | 4 +- vl.c | 114 +++++++++++++++++++++++++++++++++++--------------- vnc-auth-sasl.c | 2 +- vnc-auth-vencrypt.c | 6 +- vnc.c | 12 +++--- 24 files changed, 190 insertions(+), 142 deletions(-)