Commit graph

9208 commits

Author SHA1 Message Date
Cyrill Gorcunov
67639620cb images: Reserve tty numbers in task_core_entry
We will need them to handle tty inheritance.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:31:19 +03:00
Dmitry Safonov
0eb9cbdbf0 cr-check: Make compat_cr warning arch-independent
I think, we should warn a user when we can't C/R compatible
applications. That's valid for different than x86 archs.
Let's correct the message the way it'll suit non-x86.

Reported-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:31:04 +03:00
Andrei Vagin
c6b930b3ae criu: don't abort criu in lookup_create_item()
Currently lookup_create_item() calls BUG_ON(), if it meets a thread.
We don't expect to meet a thread there, but if images contain incorrect
data, we can be in this situation in open_remap_dead_process().

(gdb) bt

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:31:04 +03:00
Andrei Vagin
e84443bb2b dump: set pid->state for threads
It is cheched in dead_pid_conflict, otherwise criu may segfault:

Program terminated with signal 11, Segmentation fault.
1073				if (item->pid->real == item->threads[i].real ||
(gdb) p item
$1 = (struct pstree_item *) 0x0
(gdb) bt

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:31:04 +03:00
Kirill Tkhai
7c4fda0f80 ns: Implement setns_from_fdstore() for repeating code
Introduce a helper and use it instead of repeating code.
Use file and line of caller in error message printing
to allow the caller do not use additional print.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:31:04 +03:00
Dmitry Safonov
f5c11168d5 fault-inj: Silently dying helper's child
The restorer blob may die silently due to anything:
- Segmentation fault
- OOM killer
- User-sended SIGKILL
- Child CRIU restorer did't abort futex on error path (and exited)

We should terminate the restoring process and avoid locking
self up on waiting for died restoree.

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:31:03 +03:00
Dmitry Safonov
ff1c5ca693 pstree: Add nspid() helper
To get pid in ns of current.

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:30:47 +03:00
Pavel Emelyanov
9ecab6c53f page-xfer: Normalize remote/local parent xfer checks
We have two places to check for parent via page server -- as
a part of _OPEN req and explicit req. Make the latter code
be in-sync with the opening one.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:30:46 +03:00
Pavel Emelyanov
3e151f025d page-read: Warn about async read w/o completion cb
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:45 +03:00
Pavel Emelyanov
aae3cd6356 page-read: Don't check for cache/proxy in local case
The opts.remote is always false in this code.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:45 +03:00
Pavel Emelyanov
c1d90f46a2 page-read: Don't try to dedup from img cache/proxy
It's simply impossible (yet), so emit a warning.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Omri Kramer
4996c2b352 Merge img-remote and img-remote-proto
There is no real need to have both.

Signed-off-by: Omri Kramer <omri.kramer@gmail.com>
Singed-off-by: Lior Fisch <fischlior@gmail.com>
Reviewed-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
4f23a1fd90 files: Fix crossing unused and service fds of shared fd tables
service_fd_id is id of a specific task, while other tasks
in shared fd table group may have bigger id numbers.
In this case given unused fd intersects with service fds
of such tasks. This leads to undefined behaviour. Fix that.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
8cb7b43a49 restore: Fix waited task pid
The pid must be taken relative to the parent pid namespace.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
2c6327e30b restore: Do not iterate over parent's files to find leftovers
This patch speeds up creation of child process by disabling
iteration over open files for the most cases. Really, we don't
need that now, as previous patches make parent files do not leak:

mnt namespace fds are stored in fdstore, pid proc files
are closed directly.

So, now we can skip closing old files for the most cases,
except some CLONE_FILES cases: we need that only if parent
have CLONE_FILES in its flags (and for root_item).

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
2ccacac0f2 restore: Use vpid in log_init_by_pid() instead of getpid()
When task is in pid namespace, getpid() can't be used
to identify it. So, use vpid instead of that.

Also, move log_init_by_pid() above pid check.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
0d52c7e9e2 forking: Always close pid proc before child creation
Child does not know about parent's pid proc fd,
and it can't close it by fd. Next patch will do
close_old_files() optional, and it will base on
the fact there is no leftover fds. So, close pid
proc directly.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
0382311056 mnt_ns: Use fdstore to keep mount namespaces
This allows to decrese number of file descriptors,
which are passed to children, and that is need to
close in close_old_files().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>:
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
a8ab6c569e mnt: Move ns_fd assignment down in prepare_mnt_ns()
No functional changes.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
bfbd7bbacb utils: Introduce SWAP() helper to exchange two variables
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
f41a087891 mnt_ns: Move open_proc() up in prepare_mnt_ns()
The both branches need this, so move it up.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Veronika Kabatova
18c22b77c5 Modify and add test for configuration file functionality
Creating a test for verifying configuration parsing feature. The
test is created by reusing already present inotify_irmap test.

Because of addition of default configuration files, --no-default-config
option is added to zdtm.py to not break the test suite on systems with
these files present.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Veronika Kabatova
85e8216080 Add documentation for configuration files
Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Veronika Kabatova
dd348bd60a Add support for configuration files
Implementation changes for usage of simple configuration files. Before
parsing the command line options, either default configuration files
(/etc/criu/default.conf, $HOME/.criu/default.conf; in this order) are
parsed, or a specific config file passed by the user. Two new options are
introduced: "--config FILEPATH" option allows users to specify a single
configuration file they want to use; and "--no-default-config" option to
forbid the parsing of default configuration files. Both options are to be
passed only via the command line.

Usage of configuration files is not mandatory to keep backwards
compatibility. The implementation of this feature tries to be compatible
with command line usage -- the user should get the same results whether
he passes the options (in the right order of parsing) on command line or
writes them in config files. This allows the user to:

1) Override boolean options if needed
2) Specify partial configuration for options that are possible to pass
   several times (e.g. "--external"), and pass the rest of the options
   based on process runtime by command line

Configuration file syntax allows comments marked with '#' sign, the rest
of the line after '#' is ignored. The user can use one option per line
(with argument supplied on the same line if needed, divided with whitespace
characters), the options are the same as long options (without the "--"
prefix used on command line).

Configuration file example (syntax purposes only, doesn't make sense):

$ cat ~/.criu/default.conf
tcp-established
work-dir /home/<USERNAME>/criu/work_directory
extra # inline comment
no-restore-sibling
tree	111111

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Michael Holzheu
7e01425766 s390: Fix clone() syscall parameters for s390
On s390 the first two paramters are swapped because we use
the CONFIG_CLONE_BACKWARDS2 kernel config option.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
3c712e280b pstree: Do not populate zero levels of task's pid
If task's pid were hashed before the task itself
(this may happen, when another task has sid or pgid
equal to this pid), the pid mustn't contain zero
levels. So, if pgid or sid has zero levels, we should
not add them.

Otherwise, session04 --iter 3 fails with:

=[log]=> dump/zdtm/static/session04/30/2/restore.log
------------------------ grep Error ------------------------
(01.858187)      6: Restoring children in our session:
(01.858206)      6: Forking task with 303 pid (flags 0x600)
(01.869893)      1: PID: real 145 virt 15
(01.870247)      1: Forking task with 20 pid (flags 0x0)
(01.872948) Error (criu/cr-restore.c:381): 0: Write -1 to sys/kernel/ns_last_pid: Invalid argument
(01.873030) Error (criu/namespaces.c:2664): Can't set next pid
(01.873103)      1: Error (criu/ns-common.c:46): Error answer
(01.873123)      1: Error (criu/cr-restore.c:404): Can't request next pid
(01.873135)      1: Error (criu/cr-restore.c:1321): Can't set next pid
(01.873310)      1: Error (criu/cr-restore.c:1434): Can't fork for 20: No such file or directory

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Mike Rapoport
0aa9cc3641 pstree: fix prepare_dummy_pstree after rework of PID namespace
Since commit 84eedc49a (pstree: Make lookup_create_pid() able to create
tasks with pid->level > 1) the read_pstree_image function presumes that
namespaces image is already parsed.
This patch ensures that this is the case for prepare_dummy_pstree users.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
627ca7d13d zdtm: Add SIGCHLD flag to userns-leaked-sock test
wait() waits children created using SIGCHLD signal only.
Add it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Pavel Emelyanov
181ea542e3 net: Fix links collection retcode
There's a

   if (bad_thing) {
	   ret = -1;
	   break;
   }

code above this hunk, whose intention is to propagate -1 back to
caller. This propagation is obviously broken.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Dmitry Safonov
7d5ac8338d zdtm: Add infop to waitid() in pidns0{2,3}
As said in man page:
> The application shall ensure that the infop argument
> points to a siginfo_t structure.

While x86_64 ignores NULL, ia32 syscall returns error:
Test output: ================================
20:52:47.176:     4: FAIL: pidns02.c:158: Can't wait (errno = 14 (Bad address))
20:52:47.177:     4: FAIL: pidns02.c:183: Test failed (errno = 14 (Bad address))
20:52:47.177:     3: ERR: test.c:228: Test exited unexpectedly with code 255
 <<< ================================

Test output: ================================
20:53:27.835:     1: FAIL: pidns03.c:119: Can't wait (errno = 14 (Bad address))
20:53:28.207:     4: FAIL: pidns03.c:201: Can't wait or bad status: errno=0, status=32512 (errno = 0 (Success))
 <<< ================================

Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Kirill Tkhai
8df85f8c51 compel, x86_64: Fix sys_clone() definition
Commit 37e4c7bfc264 fixed arm, ppc, x86 (32bit),
while it made wrong definition of x86_64. Fix that.

Also, add commentary to raw fork() implementation.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Andrei Vagin
bbb9ed6096 restore: handle errors of restore_wait_other_tasks
In a error case, task_entries->nr_in_progress is set to -1
and we have to handle this case.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Adrian Reber
4864af0d91 zdtm: also dump and restore tests with --check-only
This adds the option '--check-only' to zdtm.py. If specified each test
cases is first dumped with the '--check-only' option enabled before the
real dump. Also during restore the test case is first restored with
--check-only before doing the real restore.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:42 +03:00
Adrian Reber
bab458b0d6 zdtm: call getpid() during gone if pid is zero
If calling gone() without ever calling getpid() before leads to
backtrace. Just call getpid() to avoid that.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:57 +03:00
Adrian Reber
59d18c8028 zdtm: add reset_pid() function
In preparation for the zdtm option '--check-only' a new helper function
reset_pid() is added which writes to ns_last_pid to avoid PID collisions
during check-only restore and the real restore.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:57 +03:00
Adrian Reber
bad73c629a restorer: skip aio restore in check-only mode
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:57 +03:00
Adrian Reber
1e03c8a25b check-only: fix network unlock in check-only mode
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:57 +03:00
Kirill Tkhai
cd16b9c687 zdtm: Add userns-leaked-sock test
1)Create a socket, bind it, then create a child in lower user, pid and net ns.
2)Close socket in parent
3)After signal, check that child can create the socket with the same name.
  (It must, as it's in another net namespace).

v2: Add uid/gid mapping.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
693e643358 user_ns: Prepare creds of newly created task
Sockets are sent via SCM_CREDENTIALS, and this kernel interface
needs to have uid and gid mapped (see __scm_send() in kernel).
So, set them before send_fds() use.

Also, move prep_usernsd_transport() below to be after this
for uniformity.

v2: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
373f9327f9 files: Add new master to file_desc if owners of existing fles have no permissions
Iterate over fake_master_head and add a fake fake fle of root_item,
which becomes new master and have permissions to restore file_desc.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
f03848309c files: Choose file master with enough permissions
On Thu, Jun 15, 2017 at 12:16, Cyrill Gorcunov wrote:
> On Thu, Jun 15, 2017 at 12:10:43PM +0300, Kirill Tkhai wrote:
> > On Wed, Jun 14, 2017 at 23:32, Andrei Vagin wrote:
> > > On Wed, Jun 07, 2017 at 02:28:53PM +0300, Kirill Tkhai wrote:
> > > > 1)Find such fle, and link it at the beginning of list.
> > > > 2)Order by pid, where possible, if it does not contradict (1)
> > >
> > > Why do we need to order by pid?
> >
> > This was initially, and I left the logic. As I know,
> > it's need for epoll, to place master in parent task.
> >
> > CC: gorcunov@virtuozzo.com
> > Cyrill, could you please say, why we need this, if you remember?
>
> I think it's the same as in bug we met.
> ---
> commit 2df9c9dc6e0b926aaba00138e3e66295ebea76ce
> Author: Cyrill Gorcunov <gorcunov@virtuozzo.com>
> Date:   Mon Apr 3 18:38:55 2017 +0300
>
>     vz7: files -- Select proper master fd when collecting fd
>
>     When choosing the master file which gonna be sending file
>     descriptor to the children we must not only look into
>     their PIDs but consider process tree relations, in particular
>     the child of a process might be choosen as a master and
>     epoll restore will fail because target files are simply
>     not present in child tree.
>
>     |  31964  31964  31964       epoll
>     |    585  31964  31964           epoll
>     |    586  31964  31964           epoll
>     |...
>     | (04.797121)    585: Error (criu/eventpoll.c:180): epoll: Unexpected state for tfd (id 0 fd 8)
>
>     That's because the target files are blong to 31964 and not
>     present in child 585, but because PID wrapp happened it
>     has been chosen as a leader which is of course wrong.
>
>     https://jira.sw.ru/browse/PSBM-63355
>
>     Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>

[PATCH v3 18/30]files: Choose file master with enough permissions

1)Find such fle, and link it at the beginning of list.
2)Order by pid, where possible, if it does not contradict (1)
3)If there is no a master, leave fdesc in fake_master_head.

v3: Describe pid order reasons

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
80c0c63b41 files: Populate file_desc::setns_userns
Do it here once to use cached value later.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
eecdaebaee net: Add file_desc_ops::get_user_ns for sockets
Return user_ns of saved net ns_id.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
ecd57e0a3c files: Add file_desc_ops::get_user_ns
Returns user_ns of file (currently it's not exported to userspace)
and minimal user_ns need for restore file (for example, socket
net_ns->user_ns, regulating setns() permittions).

This will be need to choose correct process as owner of file master.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
4eb718553a ns: Refactor top_user_ns assignment
The aim is to have top_user_ns set even if !(root_ns_mask & CLONE_NEWUSER).
This allows to avoid additional comparison top_user_ns with NULL elsewhere.

Thus, move fixup for old images to generic code, to support the case above.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
eb31ccc167 ns: Rename root_user_ns to top_user_ns
I'm going to use this in !(root_ns_mask & CLONE_NEWUSER) case,
so choose a better name to fit everything.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
b8ca87fca9 net: Fixup net ns_id of sockets on old dumps
Set them equal to top_net_ns.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
625e7f9c2a ns: Add top_net_ns global variable
It will be need for fast obtaining root_item's net_ns,
and to fixup old dumps.

v2: Add a comment to top_xxx_ns. Extend MARK_ROOT_NS().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
91b85145c0 utils: Use daemon in open_fd_of_vpid() only its really need
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00
Kirill Tkhai
a5483337b3 utils: Cleanup open_fd_of_vpid()
Move +1 up to snprintf().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:28:56 +03:00