All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <Wei.Liu2@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	wei.liu2@citrix.com,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH V4] Switch from select() to poll() in xenconsoled's IO loop
Date: Mon, 7 Jan 2013 14:44:54 +0000	[thread overview]
Message-ID: <1357569894.13581.1.camel@iceland> (raw)
In-Reply-To: <1357569587.7989.102.camel@zakaz.uk.xensource.com>

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.

  reply	other threads:[~2013-01-07 14:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03 17:14 [PATCH] Switch to poll in xenconsoled's io loop Wei Liu
2013-01-03 18:22 ` Mats Petersson
2013-01-04 12:30   ` Wei Liu
2013-01-04 15:58 ` [PATCH V2] Switch from select() to poll() in xenconsoled's IO loop Wei Liu
2013-01-04 16:08   ` Ian Campbell
2013-01-04 16:38     ` Wei Liu
2013-01-04 16:51       ` Mats Petersson
2013-01-04 17:17 ` [PATCH V3] " Wei Liu
2013-01-07 10:20   ` Ian Campbell
2013-01-07 12:12     ` Wei Liu
2013-01-07 12:16       ` Ian Campbell
2013-01-07 14:28 ` [PATCH V4] " Wei Liu
2013-01-07 14:39   ` Ian Campbell
2013-01-07 14:44     ` Wei Liu [this message]
2013-01-07 14:52     ` Ian Jackson
2013-01-07 14:41   ` Mats Petersson
2013-01-07 15:01     ` Wei Liu
2013-01-07 15:06       ` Mats Petersson
2013-01-07 15:17         ` Ian Campbell
2013-01-07 15:16       ` Ian Campbell
2013-01-07 15:24         ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1357569894.13581.1.camel@iceland \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.