]> git.ipfire.org Git - thirdparty/qemu.git/commit
monitor: Introduce monitor_fdset_*free
authorFabiano Rosas <farosas@suse.de>
Mon, 17 Jun 2024 18:57:21 +0000 (15:57 -0300)
committerFabiano Rosas <farosas@suse.de>
Thu, 20 Jun 2024 13:42:24 +0000 (10:42 -0300)
commita93ad56053e54a94875faabb042d7c60fdd2fe20
tree109eccfc634ae880529e42cfb6f5a63a34a0d258
parent1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0
monitor: Introduce monitor_fdset_*free

Introduce new functions to remove and free no longer used fds and
fdsets.

We need those to decouple the remove/free routines from
monitor_fdset_cleanup() which will go away in the next patches.

The new functions:

- monitor_fdset_free/_if_empty() will be used when a monitor
  connection closes and when an fd is removed to cleanup any fdset
  that is now empty.

- monitor_fdset_fd_free() will be used to remove one or more fds that
  have been explicitly targeted by qmp_remove_fd().

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
monitor/fds.c