[08/13] page-xfer: Use send_psi everywhere

Submitted by Pavel Emelianov on July 6, 2017, 9:40 a.m.

Details

Message ID 0fba9362-10e0-9e02-888d-92e1c91f2427@virtuozzo.com
State Accepted
Series "A set of cleanups for pagemaps/xfers/reads before master merge (resend)"
Headers show

Commit Message

Pavel Emelianov July 6, 2017, 9:40 a.m.
There are two places left that send ps_iov by hands into
socket. Switch it to use common helper.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/page-xfer.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index e2c4e10..ea38172 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -513,10 +513,8 @@  static int check_parent_server_xfer(int fd_type, long id)
 	pi.cmd = PS_IOV_PARENT;
 	pi.dst_id = encode_pm_id(fd_type, id);
 
-	if (write(page_server_sk, &pi, sizeof(pi)) != sizeof(pi)) {
-		pr_perror("Can't write to page server");
+	if (send_psi(page_server_sk, &pi))
 		return -1;
-	}
 
 	tcp_nodelay(page_server_sk, true);
 
@@ -1028,10 +1026,8 @@  int disconnect_from_page_server(void)
 	else
 		pi.cmd = PS_IOV_FLUSH;
 
-	if (write(page_server_sk, &pi, sizeof(pi)) != sizeof(pi)) {
-		pr_perror("Can't write the fini command to server");
+	if (send_psi(page_server_sk, &pi))
 		goto out;
-	}
 
 	if (read(page_server_sk, &status, sizeof(status)) != sizeof(status)) {
 		pr_perror("The page server doesn't answer");