On 27/10/2014 08:30, Fam Zheng wrote:
> 
> +static int epoll_prepare(int epollfd,
> +                         GPollFD *fds, guint nfds,
> +                         GPollFD **g_poll_fds,
> +                         guint *g_poll_nfds,
> +                         int **g_poll_fd_idx)

Please pass the QEMUPollContext to epoll_prepare.

> +        if (ctx->last_fds) {
> +            close(ctx->epollfd);
> +        }
> +        ctx->epollfd = epoll_create(1);

Please use epoll_create1 with the EPOLL_CLOEXEC flag.

> +        if (ctx->epollfd < 0) {
> +            perror("epoll_create");
> +            abort();
> +        }

Interesting.  Is it cheaper to do this than to compute a symmetric
difference?

I am worried that the epoll_create fails with EMFILE, and that the
destruction/recreation happens often with networking (which uses
qemu_set_fd_handler2) if you use the right workload.

Paolo

Reply via email to