From: Ian Jackson Subject: Re: [PATCH V4] Switch from select() to poll() in xenconsoled's IO loop Date: Mon, 7 Jan 2013 14:52:19 +0000 Message-ID: <20714.57635.386124.454096@mariner.uk.xensource.com> References: <1357233257-13918-1-git-send-email-wei.liu2@citrix.com> <1357568895.11865.1.camel@iceland> <1357569587.7989.102.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1357569587.7989.102.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Wei Liu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH V4] Switch from select() to poll() in xenconsoled's IO loop"): > On Mon, 2013-01-07 at 14:28 +0000, Wei Liu wrote > > - if (d->master_fd != -1 && FD_ISSET(d->master_fd, > > - &readfds)) ... > 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. I haven't read the patch in question but: You certainly need to check for POLLERR and POLLHUP. They appear in revents even if not requested. Normally they can be treated as fatal for the descriptor. You should also think about POLLPRI. Often it's correct to request it and then treat it as fatal for the descriptor if it occurs. Ian. (I haven't read the patch I'm afraid...)