Introduce library for socket C/R

Submitted by Pavel Emelianov on Aug. 5, 2016, 2:58 p.m.

Details

Reviewer None
Submitted Aug. 5, 2016, 2:58 p.m.
Last Updated Aug. 6, 2016, 1:42 a.m.
Revision 1

Cover Letter

Hi,

In CRIU we use the TCP repair feature to live migrate TCP connection,
but this feature cannot be used w/o CRIU. So here's the libsoccr library
that makes an attempt to make this feature use-able in another projects.

The idea of the libsoccr usage is

1) pause the socket
2) get the connection info
3) get other socket parameters (address, peer, ports, options)

to dump the socket and

1) create and pause the socket
2) restore socket's connection info (part 1)
3) restore socket's name and peer (bind and connect)
4) restore socket's connection info (part 2)
5) restore socket's queues
6) restore socket's info (part 3)
7) resume the socket

for restore. So the libsoccr handles steps 1 and 2 on dump and 1, 2, 4 through 7
on restore. Stuff like address, peer and others are left for caller for
simplicity, but, probably, these can be implemented as wrappers in libsoccr.

Changes in v2:
* Updated to support window repair
* Make library only static not to play with LD_LIBRARY_PATH-s

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
  

Revisions