From: Ian Jackson Subject: [PATCH 2/2] libxl: save helper: Recheck fd events Date: Tue, 14 Apr 2015 18:31:40 +0100 Message-ID: <1429032700-27654-2-git-send-email-ian.jackson@eu.citrix.com> References: <21805.20207.220139.608551@mariner.uk.xensource.com> <1429032700-27654-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429032700-27654-1-git-send-email-ian.jackson@eu.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: xen-devel@lists.xensource.com Cc: jfehlig@suse.com, Ian Jackson List-Id: xen-devel@lists.xenproject.org The save helper message reader does operates with the fd in blocking mode. So spurious wakeups could cause it to block, unless it takes precautions. Reported-by: Konrad Rzeszutek Wilk Signed-off-by: Ian Jackson --- tools/libxl/libxl_save_callout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c index 40b25e4..0f392ef 100644 --- a/tools/libxl/libxl_save_callout.c +++ b/tools/libxl/libxl_save_callout.c @@ -265,6 +265,8 @@ static void helper_stdout_readable(libxl__egc *egc, libxl__ev_fd *ev, STATE_AO_GC(shs->ao); int rc, errnoval; + revents = libxl__ev_fd_recheck(egc, ev); + if (revents & (POLLERR|POLLPRI)) { LOG(ERROR, "%s signaled POLLERR|POLLPRI (%#x)", shs->stdout_what, revents); -- 1.7.10.4