Lines Matching refs:mon_fdset
169 static void monitor_fdset_free(MonFdset *mon_fdset) in monitor_fdset_free() argument
171 QLIST_REMOVE(mon_fdset, next); in monitor_fdset_free()
172 g_free(mon_fdset); in monitor_fdset_free()
175 static void monitor_fdset_free_if_empty(MonFdset *mon_fdset) in monitor_fdset_free_if_empty() argument
182 if (QLIST_EMPTY(&mon_fdset->fds) && QLIST_EMPTY(&mon_fdset->dup_fds)) { in monitor_fdset_free_if_empty()
183 monitor_fdset_free(mon_fdset); in monitor_fdset_free_if_empty()
197 MonFdset *mon_fdset; in monitor_fdsets_cleanup() local
201 QLIST_FOREACH_SAFE(mon_fdset, &mon_fdsets, next, mon_fdset_next) { in monitor_fdsets_cleanup()
202 monitor_fdset_free_if_empty(mon_fdset); in monitor_fdsets_cleanup()
268 MonFdset *mon_fdset; in qmp_remove_fd() local
273 QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { in qmp_remove_fd()
274 if (mon_fdset->id != fdset_id) { in qmp_remove_fd()
277 QLIST_FOREACH_SAFE(mon_fdset_fd, &mon_fdset->fds, next, in qmp_remove_fd()
292 monitor_fdset_free_if_empty(mon_fdset); in qmp_remove_fd()
308 MonFdset *mon_fdset; in qmp_query_fdsets() local
313 QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { in qmp_query_fdsets()
316 fdset_info->fdset_id = mon_fdset->id; in qmp_query_fdsets()
318 QLIST_FOREACH(mon_fdset_fd, &mon_fdset->fds, next) { in qmp_query_fdsets()
337 MonFdset *mon_fdset = NULL; in monitor_fdset_add_fd() local
343 QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { in monitor_fdset_add_fd()
345 if (fdset_id <= mon_fdset->id) { in monitor_fdset_add_fd()
346 if (fdset_id < mon_fdset->id) { in monitor_fdset_add_fd()
347 mon_fdset = NULL; in monitor_fdset_add_fd()
354 if (mon_fdset == NULL) { in monitor_fdset_add_fd()
365 QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { in monitor_fdset_add_fd()
366 mon_fdset_cur = mon_fdset; in monitor_fdset_add_fd()
373 QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { in monitor_fdset_add_fd()
374 mon_fdset_cur = mon_fdset; in monitor_fdset_add_fd()
383 mon_fdset = g_malloc0(sizeof(*mon_fdset)); in monitor_fdset_add_fd()
385 mon_fdset->id = fdset_id; in monitor_fdset_add_fd()
387 mon_fdset->id = fdset_id_prev + 1; in monitor_fdset_add_fd()
392 QLIST_INSERT_HEAD(&mon_fdsets, mon_fdset, next); in monitor_fdset_add_fd()
393 } else if (mon_fdset->id < mon_fdset_cur->id) { in monitor_fdset_add_fd()
394 QLIST_INSERT_BEFORE(mon_fdset_cur, mon_fdset, next); in monitor_fdset_add_fd()
396 QLIST_INSERT_AFTER(mon_fdset_cur, mon_fdset, next); in monitor_fdset_add_fd()
403 QLIST_INSERT_HEAD(&mon_fdset->fds, mon_fdset_fd, next); in monitor_fdset_add_fd()
406 fdinfo->fdset_id = mon_fdset->id; in monitor_fdset_add_fd()
418 MonFdset *mon_fdset; in monitor_fdset_dup_fd_add()
421 QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { in monitor_fdset_dup_fd_add()
433 if (mon_fdset->id != fdset_id) { in monitor_fdset_dup_fd_add()
437 QLIST_FOREACH(mon_fdset_fd, &mon_fdset->fds, next) { in monitor_fdset_dup_fd_add()
467 QLIST_INSERT_HEAD(&mon_fdset->dup_fds, mon_fdset_fd_dup, next); in monitor_fdset_dup_fd_add()
479 MonFdset *mon_fdset; in monitor_fdset_dup_fd_remove() local
483 QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { in monitor_fdset_dup_fd_remove()
484 QLIST_FOREACH(mon_fdset_fd_dup, &mon_fdset->dup_fds, next) { in monitor_fdset_dup_fd_remove()
488 monitor_fdset_free_if_empty(mon_fdset); in monitor_fdset_dup_fd_remove()