From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 6/6] tools/libxl: Adjust datacopiers POLLHUP handling when the fd is also readable Date: Wed, 18 Mar 2015 11:31:35 +0000 Message-ID: <1426678295.18247.333.camel@citrix.com> References: <1426512594-11585-1-git-send-email-ross.lagerwall@citrix.com> <1426512594-11585-6-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426512594-11585-6-git-send-email-ross.lagerwall@citrix.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: Ross Lagerwall Cc: Andrew Cooper , Ian Jackson , Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2015-03-16 at 13:29 +0000, Ross Lagerwall wrote: > From: Andrew Cooper > > POLLHUP|POLLIN is a valid revent to receive when there is readable data in a > pipe, but the writable fd has been closed. This occurs in migration v2 when > the legacy conversion process (which transforms the data inline) completes and > exits successfully. > > In the case that there is data to read, suppress the POLLHUP. POSIX states > that the hangup state is latched[1], which means it will reoccur on subsequent > poll() calls. The datacopier is thus provided the opportunity to read until > EOF, if possible. > > A POLLHUP on its own is treated exactly as before, indicating a different > error with the fd. > > [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html > > Signed-off-by: Andrew Cooper Acked-by: Ian Campbell