[CRIU] [PATCH 4/5] page-server: implement epoll->hangup_event

Mike Rapoport rppt at linux.vnet.ibm.com
Wed Nov 22 22:37:11 MSK 2017


The remote page read has nothing to do if the page-server on the source has
closed the connection. Just report an error and abort.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/page-xfer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index aa5815f..1ff0516 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -1213,6 +1213,12 @@ static int page_server_async_read(struct epoll_rfd *f)
 	return ret;
 }
 
+static int page_server_hangup_event(struct epoll_rfd *rfd)
+{
+	pr_err("Remote side closed connection\n");
+	return -1;
+}
+
 static struct epoll_rfd ps_rfd;
 
 int connect_to_page_server_to_recv(int epfd)
@@ -1222,6 +1228,7 @@ int connect_to_page_server_to_recv(int epfd)
 
 	ps_rfd.fd = page_server_sk;
 	ps_rfd.read_event = page_server_async_read;
+	ps_rfd.hangup_event = page_server_hangup_event;
 
 	return epoll_add_rfd(epfd, &ps_rfd);
 }
-- 
2.7.4



More information about the CRIU mailing list