Skip to content

Clear fd handlers

Juan Quintela qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 6 repliesIn review
  2. v19 patches 4 repliesSuperseded

v1 series from the cover letter

- 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).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14Convert io handlers to QLISTvl.c+14 -216 replies
2/14remove useless castmigration-exec.c migration-fd.c+2 -40 replies
3/14rename IOCanRWHandler to IOCanReadHandlerqemu-char.c qemu-char.h qemu-common.h +2 more+9 -100 replies
4/14bt: remove bt_host_read_poll()bt-host.c+1 -80 replies
5/14Handle deleted IOHandlers in a single passvl.c+7 -100 replies
6/14tap: insert tap_can_send() into tap_send()net/tap.c+9 -180 replies
7/14qemu-char:stdio insert poll call into read oneqemu-char.c+7 -150 replies
8/14qemu-char:tcp insert poll call into read oneqemu-char.c+5 -130 replies
9/14qemu-char:fd insert poll call into read oneqemu-char.c+4 -110 replies
10/14qemu-char:pty insert poll call into read oneqemu-char.c+5 -110 replies
11/14qemu-char:udp insert poll call into read oneqemu-char.c+2 -110 replies
12/14Remove qemu_set_fd_handler2()aio.c migration-exec.c migration-fd.c +11 more+46 -640 replies
13/14Remove now unused fd_read_poll and all its only left uservl.c+1 -40 replies
14/14Add qemu_remove_fd_handler()audio/alsaaudio.c audio/ossaudio.c hw/xen_backend.c +12 more+48 -420 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/14] Clear fd handlers

in this v2 series:
- a pony for malc:

   23 files changed, 133 insertions(+), 215 deletions(-)

- a pony for Anthony
fd_read_poll is no more.

- tap/qemu-char* poll users are gone. I just folded the poll function on top of the read one. Anyone knows of a different reason that legacy for having a poll function? Only difference should be that we are calling select with more descriptors.

- rename qemu_clear_fd_handler() to qemu_remove_fd_handler() It removes it from a list, don't clear anything.

- now that pull function is gone, and remove of handler is a diffrent function, only one NULL is used by function -> no more qemu_set_fd_{read,write,poll}_handler, just old qemu_set_fd_handler.

Monitor works, and tap works. I don't know if there is any performance difference at all. Could anyone that has a setup to meassure it test it?

Later, Juan.

v1 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).

Juan Quintela (14):
Convert io handlers to QLIST
remove useless cast
rename IOCanRWHandler to IOCanReadHandler
bt: remove bt_host_read_poll()
Handle deleted IOHandlers in a single buffer
tap: insert tap_can_send() into tap_send() qemu-char:stdio insert poll call into read one qemu-char:tcp insert poll call into read one qemu-char:fd insert poll call into read one qemu-char:pty insert poll call into read one qemu-char:udp insert poll call into read one Remove qemu_set_fd_handler2()
Remove now unused fd_read_poll and all its only left user Add qemu_remove_fd_handler()

 aio.c               |    2 +-
 audio/alsaaudio.c   |    4 +-
 audio/ossaudio.c    |    6 +-
 bt-host.c           |    9 +----
 hw/xen_backend.c    |    4 +-
 migration-exec.c    |    7 +--
 migration-fd.c      |    5 +-
 migration-tcp.c     |   10 ++--
 migration-unix.c    |   10 ++--
 migration.c         |    8 ++--
 net/socket.c        |    6 +-
 net/tap.c           |   27 ++++--------
 net/vde.c           |    2 +-
 qemu-aio.h          |    4 +-
 qemu-char.c         |  112 ++++++++++++++++----------------------------------
 qemu-char.h         |   11 +----
 qemu-common.h       |    2 +-
 qemu-tool.c         |    9 ++--
 usb-linux.c         |    2 +-
 vl.c                |   92 +++++++++++++++++-------------------------
 vnc-auth-sasl.c     |    2 +-
 vnc-auth-vencrypt.c |    2 +-
 vnc.c               |   12 +++---
 23 files changed, 133 insertions(+), 215 deletions(-)