Lines Matching refs:ioh
56 IOHandlerRecord *ioh; in qemu_set_fd_handler2() local
59 QLIST_FOREACH(ioh, &io_handlers, next) { in qemu_set_fd_handler2()
60 if (ioh->fd == fd) { in qemu_set_fd_handler2()
61 ioh->deleted = 1; in qemu_set_fd_handler2()
66 QLIST_FOREACH(ioh, &io_handlers, next) { in qemu_set_fd_handler2()
67 if (ioh->fd == fd) in qemu_set_fd_handler2()
70 ioh = qemu_mallocz(sizeof(IOHandlerRecord)); in qemu_set_fd_handler2()
71 QLIST_INSERT_HEAD(&io_handlers, ioh, next); in qemu_set_fd_handler2()
73 ioh->fd = fd; in qemu_set_fd_handler2()
74 ioh->fd_read_poll = fd_read_poll; in qemu_set_fd_handler2()
75 ioh->fd_read = fd_read; in qemu_set_fd_handler2()
76 ioh->fd_write = fd_write; in qemu_set_fd_handler2()
77 ioh->opaque = opaque; in qemu_set_fd_handler2()
78 ioh->deleted = 0; in qemu_set_fd_handler2()
93 IOHandlerRecord *ioh; in qemu_iohandler_fill() local
95 QLIST_FOREACH(ioh, &io_handlers, next) { in qemu_iohandler_fill()
96 if (ioh->deleted) in qemu_iohandler_fill()
98 if (ioh->fd_read && in qemu_iohandler_fill()
99 (!ioh->fd_read_poll || in qemu_iohandler_fill()
100 ioh->fd_read_poll(ioh->opaque) != 0)) { in qemu_iohandler_fill()
101 FD_SET(ioh->fd, readfds); in qemu_iohandler_fill()
102 if (ioh->fd > *pnfds) in qemu_iohandler_fill()
103 *pnfds = ioh->fd; in qemu_iohandler_fill()
105 if (ioh->fd_write) { in qemu_iohandler_fill()
106 FD_SET(ioh->fd, writefds); in qemu_iohandler_fill()
107 if (ioh->fd > *pnfds) in qemu_iohandler_fill()
108 *pnfds = ioh->fd; in qemu_iohandler_fill()
116 IOHandlerRecord *pioh, *ioh; in qemu_iohandler_poll() local
118 QLIST_FOREACH_SAFE(ioh, &io_handlers, next, pioh) { in qemu_iohandler_poll()
119 if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, readfds)) { in qemu_iohandler_poll()
120 ioh->fd_read(ioh->opaque); in qemu_iohandler_poll()
122 if (!ioh->deleted && ioh->fd_write && FD_ISSET(ioh->fd, writefds)) { in qemu_iohandler_poll()
123 ioh->fd_write(ioh->opaque); in qemu_iohandler_poll()
127 if (ioh->deleted) { in qemu_iohandler_poll()
128 QLIST_REMOVE(ioh, next); in qemu_iohandler_poll()
129 qemu_free(ioh); in qemu_iohandler_poll()