[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V4] Switch from select() to poll() in xenconsoled's IO loop



On Mon, 2013-01-07 at 14:39 +0000, Ian Campbell wrote:
> On Mon, 2013-01-07 at 14:28 +0000, Wei Liu wrote
> > @@ -69,6 +69,7 @@ static int log_hv_fd = -1;
> >  static evtchn_port_or_error_t log_hv_evtchn = -1;
> >  static xc_interface *xch; /* why does xenconsoled have two xc handles ? */
> >  static xc_evtchn *xce_handle = NULL;
> > +static struct pollfd *xce_pollfd = NULL;
> > 
> >  struct buffer {
> >         char *data;
> [...]
> > @@ -32,6 +33,7 @@ void daemonize(const char *pidfile);
> >  bool xen_setup(void);
> > 
> >  extern struct xs_handle *xs;
> > +extern struct pollfd *xs_pollfd;
> >  extern xc_interface *xc;
> 
> xs_pollfd and the xce_pollfd can both be local to the handle_io
> function, I think.
> 
> > 
> > -                       if (d->master_fd != -1 && FD_ISSET(d->master_fd,
> > -                                                          &readfds))
> > +                       if (d->master_fd != -1 &&
> > +                           d->master_pollfd &&
> > +                           d->master_pollfd->revents & POLLIN)
> >                                 handle_tty_read(d);
> > 
> > -                       if (d->master_fd != -1 && FD_ISSET(d->master_fd,
> > -                                                          &writefds))
> > +                       if (d->master_fd != -1 &&
> > +                           d->master_pollfd &&
> > +                           d->master_pollfd->revents & POLLOUT)
> >                                 handle_tty_write(d);
> > 
> >                         if (d->last_seen != enum_pass)
> 
> This is probably one for Ian J but I wonder if you need to handle
> POLLERR or POLLHUP here. ISTR some of oddness WRT these when Ian
> implemented the libxl event subsystem.
> 

Ian J, can you elaborate on this?


Wei.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.