Age | Commit message (Collapse) | Author |
|
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>
|
|
Brought to you by
codespell -w
(using codespell v2.1.0).
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
|
|
Result of `make indent` after enabling AlignTrailingComments.
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
|
|
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
|
|
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
|
|
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>
|
|
Signed-off-by: Joshua Abraham <sinisterpatrician@gmail.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Auto-detected with pylint.
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
|
|
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
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>
|
|
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>
|
|
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>
|
|
(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>
|
|
Improve dump_tcp_conn_state() *debugibility*.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
v2: Use logerr where needed.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
Replace 8-spaces with a tab in code.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
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>
|
|
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
|
|
With window parameters, we have stuff to restore before
queues and after queues.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
|
|
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>
|
|
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
|
|
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
|