mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
Rename cr_opts.ps_port into port
Signed-off-by: Rodrigo Bruno <rbruno at gsd.inesc-id.pt> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
91b689a3a4
commit
f993926f5b
@@ -351,7 +351,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
|
||||
if (req->ps) {
|
||||
opts.use_page_server = true;
|
||||
opts.addr = req->ps->address;
|
||||
opts.ps_port = htons((short)req->ps->port);
|
||||
opts.port = htons((short)req->ps->port);
|
||||
|
||||
if (req->ps->has_fd) {
|
||||
if (!opts.swrk_restore)
|
||||
@@ -660,7 +660,7 @@ static int start_page_server_req(int sk, CriuOpts *req)
|
||||
if (setup_opts_from_req(sk, req))
|
||||
goto out_ch;
|
||||
|
||||
setproctitle("page-server --rpc --address %s --port %hu", opts.addr, opts.ps_port);
|
||||
setproctitle("page-server --rpc --address %s --port %hu", opts.addr, opts.port);
|
||||
|
||||
pr_debug("Starting page server\n");
|
||||
|
||||
@@ -669,7 +669,7 @@ static int start_page_server_req(int sk, CriuOpts *req)
|
||||
goto out_ch;
|
||||
|
||||
info.pid = pid;
|
||||
info.port = opts.ps_port;
|
||||
info.port = opts.port;
|
||||
|
||||
count = write(start_pipe[1], &info, sizeof(info));
|
||||
if (count != sizeof(info))
|
||||
|
@@ -411,8 +411,8 @@ int main(int argc, char *argv[], char *envp[])
|
||||
opts.addr = optarg;
|
||||
break;
|
||||
case 1052:
|
||||
opts.ps_port = htons(atoi(optarg));
|
||||
if (!opts.ps_port)
|
||||
opts.port = htons(atoi(optarg));
|
||||
if (!opts.port)
|
||||
goto bad_arg;
|
||||
break;
|
||||
case 'j':
|
||||
|
@@ -76,7 +76,7 @@ struct cr_options {
|
||||
struct list_head inherit_fds;
|
||||
char *libdir;
|
||||
bool use_page_server;
|
||||
unsigned short ps_port;
|
||||
unsigned short port;
|
||||
char *addr;
|
||||
int ps_socket;
|
||||
bool track_mem;
|
||||
|
14
page-xfer.c
14
page-xfer.c
@@ -297,7 +297,7 @@ static int get_sockaddr_in(struct sockaddr_in *addr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
addr->sin_port = opts.ps_port;
|
||||
addr->sin_port = opts.port;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ int cr_page_server(bool daemon_mode, int cfd)
|
||||
goto no_server;
|
||||
}
|
||||
|
||||
pr_info("Starting page server on port %u\n", (int)ntohs(opts.ps_port));
|
||||
pr_info("Starting page server on port %u\n", (int)ntohs(opts.port));
|
||||
|
||||
sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (sk < 0) {
|
||||
@@ -339,14 +339,14 @@ int cr_page_server(bool daemon_mode, int cfd)
|
||||
}
|
||||
|
||||
/* Get socket port in case of autobind */
|
||||
if (opts.ps_port == 0) {
|
||||
if (opts.port == 0) {
|
||||
if (getsockname(sk, (struct sockaddr *)&saddr, &slen)) {
|
||||
pr_perror("Can't get page server name");
|
||||
goto out;
|
||||
}
|
||||
|
||||
opts.ps_port = ntohs(saddr.sin_port);
|
||||
pr_info("Using %u port\n", opts.ps_port);
|
||||
opts.port = ntohs(saddr.sin_port);
|
||||
pr_info("Using %u port\n", opts.port);
|
||||
}
|
||||
|
||||
no_server:
|
||||
@@ -411,7 +411,7 @@ int connect_to_page_server(void)
|
||||
}
|
||||
|
||||
pr_info("Connecting to server %s:%u\n",
|
||||
opts.addr, (int)ntohs(opts.ps_port));
|
||||
opts.addr, (int)ntohs(opts.port));
|
||||
|
||||
page_server_sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (page_server_sk < 0) {
|
||||
@@ -450,7 +450,7 @@ int disconnect_from_page_server(void)
|
||||
return 0;
|
||||
|
||||
pr_info("Disconnect from the page server %s:%u\n",
|
||||
opts.addr, (int)ntohs(opts.ps_port));
|
||||
opts.addr, (int)ntohs(opts.port));
|
||||
|
||||
if (opts.ps_socket != -1)
|
||||
/*
|
||||
|
Reference in New Issue
Block a user