mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
soccr: Rename API calls to save/restore
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
ed5081041c
commit
332b945f79
@ -123,7 +123,7 @@ static int dump_tcp_conn_state(struct inet_sk_desc *sk)
|
|||||||
char *buf;
|
char *buf;
|
||||||
struct libsoccr_sk_data data;
|
struct libsoccr_sk_data data;
|
||||||
|
|
||||||
ret = libsoccr_get_sk_data(socr, &data, sizeof(data));
|
ret = libsoccr_save(socr, &data, sizeof(data));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err_r;
|
goto err_r;
|
||||||
if (ret != sizeof(data)) {
|
if (ret != sizeof(data)) {
|
||||||
@ -350,7 +350,7 @@ static int restore_tcp_conn_state(int sk, struct libsoccr_sk *socr, struct inet_
|
|||||||
goto err_c;
|
goto err_c;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* O_NONBLOCK has to be set before libsoccr_set_sk_data_noq(),
|
* O_NONBLOCK has to be set before libsoccr_restore(),
|
||||||
* it is required to restore syn-sent sockets.
|
* it is required to restore syn-sent sockets.
|
||||||
*/
|
*/
|
||||||
if (restore_prepare_socket(sk))
|
if (restore_prepare_socket(sk))
|
||||||
@ -359,7 +359,7 @@ static int restore_tcp_conn_state(int sk, struct libsoccr_sk *socr, struct inet_
|
|||||||
if (read_tcp_queues(socr, &data, img))
|
if (read_tcp_queues(socr, &data, img))
|
||||||
goto err_c;
|
goto err_c;
|
||||||
|
|
||||||
if (libsoccr_set_sk_data(socr, &data, sizeof(data)))
|
if (libsoccr_restore(socr, &data, sizeof(data)))
|
||||||
goto err_c;
|
goto err_c;
|
||||||
|
|
||||||
if (tse->has_nodelay && tse->nodelay) {
|
if (tse->has_nodelay && tse->nodelay) {
|
||||||
|
@ -327,7 +327,7 @@ err_recv:
|
|||||||
*/
|
*/
|
||||||
#define SOCR_DATA_MIN_SIZE (17 * sizeof(__u32))
|
#define SOCR_DATA_MIN_SIZE (17 * sizeof(__u32))
|
||||||
|
|
||||||
int libsoccr_get_sk_data(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)
|
int libsoccr_save(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size)
|
||||||
{
|
{
|
||||||
struct tcp_info ti;
|
struct tcp_info ti;
|
||||||
|
|
||||||
@ -622,7 +622,7 @@ static int restore_fin_in_snd_queue(int sk, int acked)
|
|||||||
static int libsoccr_set_queue_bytes(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size,
|
static int libsoccr_set_queue_bytes(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size,
|
||||||
int queue, char *buf);
|
int queue, char *buf);
|
||||||
|
|
||||||
int libsoccr_set_sk_data(struct libsoccr_sk *sk,
|
int libsoccr_restore(struct libsoccr_sk *sk,
|
||||||
struct libsoccr_sk_data *data, unsigned data_size)
|
struct libsoccr_sk_data *data, unsigned data_size)
|
||||||
{
|
{
|
||||||
int mstate = 1 << data->state;
|
int mstate = 1 << data->state;
|
||||||
|
@ -136,7 +136,7 @@ void libsoccr_resume(struct libsoccr_sk *sk);
|
|||||||
* Roughly the checkpoint steps for sockets in supported states are
|
* Roughly the checkpoint steps for sockets in supported states are
|
||||||
*
|
*
|
||||||
* h = libsoccr_pause(sk);
|
* h = libsoccr_pause(sk);
|
||||||
* libsoccr_get_sk_data(h, &data, sizeof(data))
|
* libsoccr_save(h, &data, sizeof(data))
|
||||||
* inq = libsoccr_get_queue_bytes(h, TCP_RECV_QUEUE, 0)
|
* inq = libsoccr_get_queue_bytes(h, TCP_RECV_QUEUE, 0)
|
||||||
* outq = libsoccr_get_queue_bytes(h, TCP_SEND_QUEUE, 0)
|
* outq = libsoccr_get_queue_bytes(h, TCP_SEND_QUEUE, 0)
|
||||||
* getsocname(sk, &name, ...)
|
* getsocname(sk, &name, ...)
|
||||||
@ -157,7 +157,7 @@ void libsoccr_resume(struct libsoccr_sk *sk);
|
|||||||
* data_size shows the size of a buffer. The returned value is the
|
* data_size shows the size of a buffer. The returned value is the
|
||||||
* amount of bytes put into data (the rest is zeroed with memcpy).
|
* amount of bytes put into data (the rest is zeroed with memcpy).
|
||||||
*/
|
*/
|
||||||
int libsoccr_get_sk_data(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size);
|
int libsoccr_save(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get a pointer on the contents of queues. The amount of bytes is
|
* Get a pointer on the contents of queues. The amount of bytes is
|
||||||
@ -184,9 +184,7 @@ char *libsoccr_get_queue_bytes(struct libsoccr_sk *sk, int queue_id, int steal);
|
|||||||
* sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
* sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
*
|
*
|
||||||
* h = libsoccr_pause(sk)
|
* h = libsoccr_pause(sk)
|
||||||
* bind(sk, &name, ...)
|
* libsoccr_restore(h, &data, sizeof(data))
|
||||||
*
|
|
||||||
* libsoccr_set_sk_data(h, &data, sizeof(data))
|
|
||||||
*
|
*
|
||||||
* libsoccr_resume(h)
|
* libsoccr_resume(h)
|
||||||
*
|
*
|
||||||
@ -197,6 +195,6 @@ char *libsoccr_get_queue_bytes(struct libsoccr_sk *sk, int queue_id, int steal);
|
|||||||
/*
|
/*
|
||||||
* Performs restore actions on bind()-ed socket
|
* Performs restore actions on bind()-ed socket
|
||||||
*/
|
*/
|
||||||
int libsoccr_set_sk_data(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size);
|
int libsoccr_restore(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user