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

[Xen-devel] [PATCH 2/2] libxl: save helper: Recheck fd events



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 <konrad.wilk@xxxxxxxxxx>
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 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


_______________________________________________
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®.