Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/soccr
AgeCommit message (Collapse)Author
2022-04-29Fix remaining codespell warningsKir Kolyshkin
Those that codespell have a few variants for: ./soccr/soccr.c:219: thise ==> these, this ./soccr/soccr.c:444: sence ==> sense, since ./criu/net.c:665: ot ==> to, of, or ./criu/net.c:775: ot ==> to, of, or ./criu/files.c:1244: wan't ==> want, wasn't ./criu/kerndat.c:1141: happend ==> happened, happens, happen ./criu/mount-v2.c:781: carefull ==> careful, carefully ./test/zdtm/static/socket_aio.c:54: Chiled ==> Child, chilled ./test/zdtm/static/socket_listen6.c:73: Chiled ==> Child, chilled ./test/zdtm/static/socket_listen.c:73: Chiled ==> Child, chilled ./test/zdtm/static/socket_listen4v6.c:73: Chiled ==> Child, chilled ./test/zdtm/static/sk-unix-dgram-ghost.c:201: childs ==> children, child's ./test/zdtm/static/sk-unix-dgram-ghost.c:205: childs ==> children, child's ./compel/arch/x86/src/lib/infect.c:297: automatical ==> automatically, automatic, automated While at it, do some other minor fixes in the same lines. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29Fix some codespell warningsKir Kolyshkin
Brought to you by codespell -w (using codespell v2.1.0). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29clang-format: do automatic comment fixupsPavel Tikhomirov
Result of `make indent` after enabling AlignTrailingComments. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2021-09-03Run 'make indent' on header filesAdrian Reber
Acked-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Adrian Reber <areber@redhat.com>
2021-09-03Run 'make indent' on all C filesAdrian Reber
Acked-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Adrian Reber <areber@redhat.com>
2021-09-03Whitespace at EOL cleanup and checkKir Kolyshkin
My editor (vim) auto-removes whitespace at EOL for *.c and *.h files, and I think it makes sense to have a separate commit for this, rather than littering other commits with such changes. To make sure this won't pile up again, add a line to Makefile under the linter target to check for such things (so CI will fail). This is all whitespace except an addition to Makefile. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-20soccr/test: Fix error logging in libsoccr tcp-testJosh Abraham
Signed-off-by: Joshua Abraham <sinisterpatrician@gmail.com>
2020-02-04style: Enforce kernel style -Wstrict-prototypesNicolas Viennot
Include warnings that the kernel uses during compilation: -Wstrict-prototypes: enforces full declaration of functions. Previously, when declaring extern void func(), one can call func(123) and have no compilation error. This is dangerous. The correct declaration is extern void func(void). Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com> [Generated a commit message from the pull request] Signed-off-by: Dmitry Safonov <dima@arista.com>
2019-09-07test/other: Resolve Py3 compatibility issuesRadostin Stoyanov
When Python 2 is not installed we assume that /usr/bin/python refers to version 3 of Python and the executable /usr/bin/python2 does not exist. This commit also resolves a compatibility issue with Popen where in Py2 file descriptors will be inherited by the child process and in Py3 they will be closed by default. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-09-07py: Reformat everything into pep8 styleAndrei Vagin
As discussed on the mailing list, current .py files formatting does not conform to the world standard, so we should better reformat it. For this the yapf tool is used. The command I used was yapf -i $(find -name *.py) Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2019-09-07Convert spaces to tabsRadostin Stoyanov
There are a few places where spaces have been used instead of tabs for indentation. This patch converts the spaces to tabs for consistency with the rest of the code base. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-10-30soccr: print errno if connect() failedAndrey Vagin
https://github.com/checkpoint-restore/criu/issues/557 Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Acked-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30Convert to python3 style print() syntaxRadostin Stoyanov
Use __future__ imports to keep this working for python2 Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30python: Remove unused importsRadostin Stoyanov
Auto-detected with pylint. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-05-12Remove redundant semicolonsRadostin Stoyanov
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23build: Move generated config.h into include/common/Dmitry Safonov
config.h is a generated file with "build-features" defines. We use it for several purposes: o to check that compiler can do it's job o to complement user-visible API between distributions o to add compile-time options from .config global file It's used in criu and soccr, but compel also needs such thing. Previously, soccr has a link to config.h in criu includes, but it would be much cleaner to move it to other headers, that are shared between sub-projects into include/common. Reported-by: Adrian Reber <areber@redhat.com> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Tested-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23soccr: c/r ipv6 sockets which handles ipv4 connectionsAndrei Vagin
IPv6 listening sockets can accept both ipv4 and ipv6 connections, in both cases a family of an accepted socket will be AF_INET6. But we have to send tcp packets accoding with a connection type. ------------------------ grep Error ------------------------ (00.002320) 53: Debug: Will set rcv_wscale to 7 (00.002325) 53: Debug: Will turn timestamps on (00.002331) 53: Debug: Will set mss clamp to 65495 (00.002338) 53: Debug: Restoring TCP 1 queue data 2 bytes (00.002403) 53: Error (soccr/soccr.c:673): Unable to send a fin packet: libnet_write_raw_ipv6(): -1 bytes written (Network is unreachable) (00.002434) 53: Error (criu/files.c:1191): Unable to open fd=3 id=0x6 (00.002506) Error (criu/cr-restore.c:2171): Restoring FAILED. ------------------------ ERROR OVER ------------------------ Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17libsoccr: ignore data in a sent queue, if a connect is closedAndrei Vagin
If a connection was reseted, it can have some data in a sent queue, a use can't read this data, so we can ignore them too. https://jira.sw.ru/browse/PSBM-67026 Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17tcp: be ready that a size of tcp_info can be changedAndrei Vagin
(00.052683) Error (soccr/soccr.c:166): Failed to obtain TCP_INFO: No error information We don't need a whole tcp info, so get only a part what we are going to use. Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-21sk-tcp: Print libsoccr_save() error messageKirill Tkhai
Improve dump_tcp_conn_state() *debugibility*. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-19soccr: clean a bit includes listDmitry Safonov
soccr.h: After previous patch <linux/types.h> is not needed anymore, <netinet/tcp.h> is needed as we test for it in feature tests, i.e., struct tcp_repair_window is declared there. Also drop forward-declaration of (struct libsoccr_sk) - it's declared again below. soccr.c: Sort headers by name so errors like twice-including errno.h will not happen again. Also remove assert.h. Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-19soccr.h: use uint32_t instead of __u32Dmitry Safonov
As uint32_t already has occupied the header, use it for all 32-bit unsigns. That will allow to drop additional include <linux/types.h>. Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-10soccr: fix log messages and add a few moreAndrei Vagin
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-11soccr: Print errors in send_fin (v2)Pavel Emelyanov
v2: Use logerr where needed. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-11Spring whitespace cleanupKir Kolyshkin
Replace 8-spaces with a tab in code. Signed-off-by: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-02-01soccr: add one more test to check libsoccr_save/libsoccr_restoreAndrei Vagin
The previous test uses only libsoccr_restore. This test creates a tcp connection, then it dumps and restore it. travis-ci: success for soccr: add one more test to check libsoccr_save/libsoccr_restore Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: Add call to release the soccr handlerPavel Emelyanov
It's the same as libsoccr_resume, but doesn't mess with the socket file descriptor. Just release the handle. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: add a testAndrei Vagin
This test construct both ends of tcp connections and check that it works in both directions. travis-ci: success for soccr: add a test Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16tcp: bind tcp sockets after enabling the repair modeAndrei Vagin
Only sockets in the repair mode can be bound to the same port a few time, what is required to restore tcp connects. v2: move bind() into libsoccr v3: fix an error message Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: Move src/dst address from _dataPavel Emelyanov
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16soccr: Move queue pointers from _dataPavel Emelyanov
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16soccr: Introduce flags for memory passingPavel Emelyanov
There will be calls that return objects from inside library and vice versa -- accept objects from caller. Let's have a flag controlling who's going to free the mem in question. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16soccr: Rename API calls to save/restorePavel Emelyanov
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16soccr: don't dereference data before null checkAndrei Vagin
CID 173075 (#1 of 1): Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking data suggests that it may be null, but it has already been dereferenced on all paths leading to the check. travis-ci: success for soccr: don't dereference data before null check Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: restore queues from soccrAndrei Vagin
Looks like it is internal logic too, so it may be better to move into the library too. travis-ci: success for soccr: restore queues from soccr Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: add support for syn-sent socketsAndrei Vagin
For that we restore all sockets properties and then disable the repair mode before calling connect() and the kernel will sent a syn packet and move the socket into the sys-sent state. travis-ci: success for series starting with [01/21] build: install libnet-dev Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: add support for half-closed socketsAndrei Vagin
A socket is in one of half-closed states, if it sent a fin packet or it received a fin packet. CRIU plays with fin packets to restore half-closed states too. When we need to sent a fin packet from a socket, we can call shutdown(SHUT_WR). When a fin packet has to be restore in a received queue, criu generate a fin packet and send it via a raw ip socket. A raw packet is sent with the SOCCR_MARK mark to be able to not block it. v2: remove the SOCCR_FLAGS_ACKED_FIN flag introduce sets of bits for different actions with fin packets travis-ci: success for series starting with [01/21] build: install libnet-dev Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: move connect from criu to soccrAndrei Vagin
We will need to disable the repair mode before connect() to restore syn-sent sockets. And even now connect() looks like a part of internal logic of libsoccr. travis-ci: success for series starting with [01/21] build: install libnet-dev v2: remove libsoccr_set_sk_data_unbound() from soccr.h Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: add source and destination addresses to libsoccr_sk_dataAndrei Vagin
These addresses will be used to restore half-closed sockets, we will need to send a fake fin packet for that. And in the next patch connect() will be moved into soccr. Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: add prefixes for log messages and print errnoAndrei Vagin
loge() will start a message with "Error:" and logd() will start a message with "Debug:". logerr() will add strerror(errno) to the end of messages. travis-ci: success for series starting with [01/21] build: install libnet-dev Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: add '\n' to all loge/logdAdrian Reber
Some of the loge messages where missing a '\n'. For consistency this adds '\n' to all messages which were missing it. travis-ci: success for libsoccr debug/info messages (rev2) Signed-off-by: Adrian Reber <areber@redhat.com> Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: Generate config.h dynamicallyCyrill Gorcunov
Otherwise there is a broken symlink which makes tags/etags unhappy. travis-ci: success for soccr: Generate config.h dynamically (rev5) Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> [extended .gitignore, maked link relative to sources] Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: rectify Alpine buildDmitry Safonov
Made a symlink to CRIU's generated config.h, played with moving some code to soccr.h header. Changed types from u32 to uint32_t, otherwise we should include CRIU's "int.h" in soccr, but I'm lazy to add that. Cc: Pavel Emelyanov <xemul@virtuozzo.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: Add soccr.h's commentsPavel Emelyanov
TODO: Write proper man page/doc. TODO: Document that the library spoils the reuseaddrs option on socket. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr: Handle connection statePavel Emelyanov
For now we only support ESTABLISHED state, so this is mostly a preparation for the future extention. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr/tcp: Restore queues using libraryPavel Emelyanov
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr/tcp: Restore socket's info after binding itPavel Emelyanov
With window parameters, we have stuff to restore before queues and after queues. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr/tcp: Restore socket's info before binding itPavel Emelyanov
In TCP repair some stuff should be restored before calling connect/bind on socker and some -- after it. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr/tcp: Read queues contents using libraryPavel Emelyanov
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16soccr/tcp: Fill actual connection info using the libraryPavel Emelyanov
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>