Commit graph

6718 commits

Author SHA1 Message Date
Andrew Vagin
8a2cefcc04 zdtm: save output of all tests in the /output file of a report
Jenkins sends this files as a message body if something failed.

Cc: Sergey Bronnikov <sergeyb@openvz.org>
Fixes: 474f2dfc5d ("zdtm.py: add option --keep-going")
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-31 15:02:37 +03:00
Andrew Vagin
03cd507053 criu: don't interrupt do_new_mount() after appling mount options
Reported-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Cc: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-31 15:02:37 +03:00
Kirill Tkhai
c2ff0418e1 aio: Consider AIO pages as "should be dumped"
We were luckely on built-in tests, because always
AIO pages were present, and, thus, they are dumped.
But AIO pages are not guaranteed to be present
in common case.

This patch makes AIO pages are dumped certanly.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-31 15:02:37 +03:00
Kirill Tkhai
51ff6240e4 aio: Refactor nr_req calculation
nr_req always depends on ring size and we even check for that.

Kill parasite_aio::max_reqs,vma_nr_reqs and vma_area::aio_nr_req,
because they are not need and excess.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-31 15:02:37 +03:00
Kirill Tkhai
9dd414c2de aio: Change pair of debug messages
The first is a preparation to kill aio_nr_req. The second
and the third are to have more debug info at restore.

v2: Print mmap err code

Signed-off-by: Kirill Tkhai <ktkhai@vituozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-31 15:02:37 +03:00
Andrew Vagin
f55265f0f5 zdtm: handle unknown flavors
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-31 12:48:59 +03:00
Dmitry Safonov
fa8b12a1ec Makefile: suppress git describe warnings
This should fix errors on build envs, where git tags haven't
been fetched. I.e, Travis-ci does not fetch tags before
building a project, wich results in:
   ---> Running in 0d63a3d28a7a
  fatal: No names found, cannot describe anything.
  fatal: No names found, cannot describe anything.
  make[1]: Entering directory '/criu'

The other way is to fetch tags on `git describe` failure, but
it that way has two cons:
- it will change user's git (and I'm not sure it's right);
- we need not only fetch tags in that case, but also remotes,
  as otherwise it will fail with "fatal: No tags can describe <hash>":
  https://travis-ci.org/0x7f454c46/criu/jobs/133362045#L1748

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>
2016-05-30 13:47:54 +03:00
Pavel Tikhomirov
39cbd91672 crit/decode: set default opts['nopl'] to False
to fix error:

./crit/crit decode -i test/dump/zdtm/static/maps04/118/1/stats-dump
Traceback (most recent call last):
  File "./crit/crit", line 276, in <module>
    main()
  File "./crit/crit", line 273, in main
    opts["func"](opts)
  File "./crit/crit", line 28, in decode
    img = pycriu.images.load(inf(opts), opts['pretty'], opts['nopl'])
KeyError: 'nopl'

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:47:54 +03:00
Pavel Emelyanov
4ead159258 crit: Show no payload for image objects
In some images there can be quite a long "payload" -- some
raw data that is represented by base64 encoding. If we want
to explore huge images reading tons of base64 symbols can
be quite time consuming :) E.g. I a 1.5 gigs image with sysv
shmem was sent to me some time ago for investigation %)

So here is the --nopl argument for show action (decode should
produce encode-able image, so payload there is needed) that
just shows the amount of bytes in payload (if any).

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:47:54 +03:00
Dmitry Safonov
f77cb85806 aarch64/pie/util-vdso: workaround for vdso_symbols relocation
This seems to be known problem in util-vdso.c on aarch64 [1].

Now restorer segfaults with the following log:
[ 8107.384817] criu[5135]: unhandled level 3 translation fault (11) at 0x00005b98, esr 0x90000007
[ 8107.385538] pgd = ffffffc038dbc000
[ 8107.386046] [00005b98] *pgd=0000000078d6c003, *pud=0000000078d6c003, *pmd=0000000073c31003, *pte=0000000000000000
[ 8107.391920]
[ 8107.392521] CPU: 0 PID: 5135 Comm: criu Not tainted 4.5.0 #29
[ 8107.392805] Hardware name: linux,dummy-virt (DT)
[ 8107.393140] task: ffffffc039a2a400 ti: ffffffc033c34000 task.ti: ffffffc033c34000
[ 8107.393782] PC is at 0x13514
[ 8107.406332] LR is at 0x1342c
[ 8107.406550] pc : [<0000000000013514>] lr : [<000000000001342c>] pstate: a0000000

This is because gcc for aarch64 adds vdso_symbols array to symbols
table and by that reason, it needs run-time relocations in place.

How it goes (with cut not interesting assembly):
  0x14104:	adrp	x7, 0x14000	; adrp+add loading of
  0x14114:	add	x0, x7, #0x928	; symbol table's address,
  0x14134:	ldp	x2, x3, [x0]	; loading address of symbol from
					; symbol table
  0x1414c:	stp	x2, x3, [x29,#112] ; saving it on stack on
					; function's begin
  0x14188:	ldr	x2, [x29,#112]	; using symbol's address in code

The symbol for this in symbol table is:
  [root@alarm cr]# readelf -s criu/pie/restorer.built-in.bin.o | grep 5b98
    248: 0000000000005b98     0 NOTYPE  LOCAL  DEFAULT    1 $d
And also may be visible this way:
  objdump -dS criu/pie/restorer.built-in.bin.o | less
  ...
  0000000000004924 <cur_loglevel>:
      4924:       00000002 00005b98 00000000 00005ed0     .....[.......^..
      4934:       00000000 00005ee8 00000000 00005f00     .....^......._..

So, in a symbol table lies not relocated address of symbol.
The real address may be visible with added printing of vdso_symbols[0]:
pie: vdso: vdso_symbols[0] 0x15b98
(this way gcc by some reason does access symbol through
local adrp+add calculations, than through stack-saved pointer
of a symbol from symbol table).

While we don't handling properly relocs here, I suggest this
ugly workaround.

Temporary fix for: #150

[1]: https://lists.openvz.org/pipermail/criu/2015-October/022453.html

Cc: Wang Long <long.wanglong@huawei.com>
Cc: Christopher Covington <cov@codeaurora.org>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Tested-by: long.wanglong <long.wanglong@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:47:54 +03:00
Dmitry Safonov
de71b6d690 parasite-vdso: add casts from uint64_t
As for compatible 32-bit pie size of uint64_t is bigger than size of
unsigned long type, add proper casts, so we could build compatible pie.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:47:54 +03:00
Cyrill Gorcunov
a870a170dc build: Generate criu version from toplevel
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:47:52 +03:00
Cyrill Gorcunov
08bb98266b build: Move ARCH handling on toplevel
We are going to build everything from toplevel
for convenience (just like it was before criu 2)
so move one more snippet on top.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:46:28 +03:00
Cyrill Gorcunov
8a4c16fba0 build: criu -- Drop host vars
They are already defined and exported.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:46:28 +03:00
Cyrill Gorcunov
17ae160b33 build: Add export of sublevels and extra
We use in our PCS7 packaging and I think it's
suitable for everything else as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-30 13:46:28 +03:00
Pavel Emelyanov
346a4378b1 shmem: Fix print format for vme->start
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:47:33 +03:00
Andrew Vagin
06968075d1 action-scripts: include bug.h
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:47:33 +03:00
Andrew Vagin
d10768719b zdtm/netns-dev: restrict hop_limit sysctl setting to range [1;255]
$ git log v4.4-rc1-465-gd6df198
commit d6df198d924775e4751561cf60ef0294e95f74df
Author: Phil Sutter <phil@nwl.cc>
Date:   Tue Dec 1 22:45:15 2015 +0100

    net: ipv6: restrict hop_limit sysctl setting to range [1; 255]

    Setting a value bigger than 255 resulted in using only the lower eight
    bits of that value as it is assigned to the u8 header field. To avoid
    this unexpected result, reject such values.

https://github.com/xemul/criu/issues/164
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:47:33 +03:00
Andrew Vagin
dc21641ba5 shmem: use PRI64 to print u64 (v2)
shmem.c:290:4: note: in expansion of macro 'pr_err'
    pr_err("Shmem %lx already collected as SYSVIPC\n", vi->shmid);
    ^

v2: fix one more place
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:47:33 +03:00
Andrew Vagin
a4facc6b55 zdtm/mnt_tracefs: mount tracefs and don't affect an external mount namepace
====================== Run zdtm/static/mnt_tracefs in uns ======================
Start test
./mnt_tracefs --pidfile=mnt_tracefs.pid --outfile=mnt_tracefs.out --dirname=mnt_tracefs.test
Run criu dump
Wait for zdtm/static/mnt_tracefs to die for 0.100000
Run criu restore
Run criu dump
Run criu restore
Run criu dump
Run criu restore
1: Old mounts lost: set([])
1: New mounts appeared: set([('/', '/debugfs/tracing')])
Wait for zdtm/static/mnt_tracefs to die for 0.100000

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:47:33 +03:00
Pavel Emelyanov
df8e3a8a61 crtools.h: Move LAST_PID_PATH to util.h
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:47:33 +03:00
Pavel Emelyanov
1335956a8c crtools.h: Drop protobuf.h inclusion
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:52 +03:00
Pavel Emelyanov
7449224c8a image.h: Remove its inclusion from wherever possible
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:28 +03:00
Pavel Emelyanov
27477e3317 image.h: Move TASK_FOO states into pid.h
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:28 +03:00
Pavel Emelyanov
97b716a8cc image.h: Move sk-unix stuff into .c file
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:28 +03:00
Pavel Emelyanov
d3598694aa util: Remove unneeded include
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:28 +03:00
Pavel Emelyanov
049f83451c headers: Remove some dead code
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:28 +03:00
Pavel Emelyanov
69b8cac2f0 util: Rename move_img_fd
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:28 +03:00
Pavel Emelyanov
09cee18aa9 util: Move shmalloc to rst-malloc
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:46:26 +03:00
Pavel Emelyanov
6319ca2b4d restore: Move memory restoring code into mem.c
All the dumping code sits in there, so it's time to move the restoring
one there too :)

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:45:01 +03:00
Pavel Emelyanov
4cd990c375 shmem: Unify dump-time hash and restore-time list
We have 3 structures and 2 ways to keep them while doing C/R.
Let's unify the vma_area is -- one struct with union and a
hash table.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Pavel Emelyanov
dbd92e90c6 mem: Rework vma open
We now have two places where we if/elseif/elseif/else a vma
and take actions -- the prepare_mm_pid and open_vmas. I propose
to make this if/... onlce once (while preparing) and set up
a callback on vma to be called later (while opening).

This requires my patch that doesn't set -1 in alloc_vma or
Andrey's patch that does the same.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Pavel Emelyanov
ce9b04007d test: Test for partially mprotect()-ed sysv shmem segment
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Pavel Emelyanov
c7b5efd0ba ipc: Restore mprotected sysvshmems
Image a process has done shmget(2 pages), then shmat() then
mprotect(1 page, ro). In this case criu will dump 1 shmem
segment 2 pages long and 2 vmas 1 page each.

But on restore time we'll call shmat() for _each_ vma and the
very first one will occupy the whole 2 pages space in vm
(there's no size argument for shmat, only for shmget) thus
blocking the 2nd vma from shmat()-in again.

The solution is:

1. check that each shmem segment is attached by
   the sequence of vmas that cover one w/o holes

2. shmat() only the first one

3. mprotect() all of them if needed (there's no hunks
   for this step in this path, mprotect is already
   called in pie/restorer.c and does things well)

v2:

* List can contain anon shmems (caught by zdtm)
* There can be many attachments of a segment (caught by transition/ipc)

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Cyrill Gorcunov
5a44eca1df tty: Don't forget to unblock tty peers
When testing for queued data present on
peers we setup non-blocking mode over them
to obtain -EAGAIN if there is no data
at all, but I forget to restore former
mode on return, ie blocking read.

Reported-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Cyrill Gorcunov
c9a22844dd tty: Save @flags unconditionaly for consistency
For easier reading: we need it for pty queued data only,
but this way the code is simplier.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Andrey Ryabinin
d697415e9a test/sockets: add test for shut down stream unix sockets
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Andrey Ryabinin
ed4db7230a sk-unix: ignore shutdown mismatch in unix sockets
Usually unix stream sockets have consistent shutdown state
(if one end shutdown for read than other end will be shut down for write).
However sometimes it's possible to have stream sockets with mismatched
shutdown state. This happens if we connect() already shut down socket
(see upcoming sockets03.c test for example).

On read()/write() kernel always checks shutdown state on both ends, so
from userspace POV sockets with mismatched shutdown state behave the same
way as with matched state. So I think that we can just ignore shutdown
mismatch during dump, and just restore sockets with matching shutdown
state. Process should not see the differences.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Tycho Andersen
8239be8ff9 mount: support recursive bind mounts
The inital mount() call for a bind mount needs to have the MS_REC flag
present if the bind mount is recursive.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Pavel Tikhomirov
78948f96cd net/sysctl: zero-init stable_secret strings
Sting field sysctl_entry.sarg has wrong length in protobuf encoding in
netdev-9 image, according to
https://developers.google.com/protocol-buffers/docs/encoding :

In netdev-9.img binary representation of sarg field is: "1a 2c 32 36 30
37 3a 66 30 64 30 3a 31 30 30 32 3a 30 30 35 31 3a 30 30 30 30 3a 30 30
30 30 3a 30 30 30 30 3a 30 30 30 34 0a c0 f4 a7 01"
Field key is 0x1a - means type 2(Length-delimited field), field 3 - that
is sarg field.
Field len is 0x2c which is 44, first 40-byte
"2607:f0d0:1002:0051:0000:0000:0000:0004\0" and then last 4 - "c0 f4 a7
01" where 0xc0 is not utf-8, and that makes crit fail.

In sysctl_op we just read() from sysctl so no '\0' is added in the end
of the string. So we can zero-init arrays and that will fix the issue.

https://github.com/xemul/criu/issues/161

*Alternatively or additionaly we can put '\0' in the end of string in
sysctl_read_char to make it harder to make such a mistake in future.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Tycho Andersen
52db8e4d9b gitignore: ignore some more test binaries
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Tycho Andersen
fb4bb20721 add a tracefs test
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:02 +03:00
Pavel Tikhomirov
89e8aa90c4 net/sysctl: remove excess type conversions for sysctl_entry.type
use native SYSCTL_TYPE__CTL_32 and SYSCTL_TYPE__CTL_STR

v2: add BUILD_BUG_ONS to check SysctlType constants are equal to
__CTL_STR and CTL_32, change __CTL_STR to CTL_STR in SysctlType enum.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00
Cyrill Gorcunov
11c4f5f6f2 criu: pie, log -- Print tid of writting process
For more convenient log parsing.

Reported-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00
Cyrill Gorcunov
969b87e9e0 criu: pie, log -- Make sbuf_printf static
Not exported anywhere.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00
Andrew Vagin
cc1a321c9d sk-inet: fix a value of INET_ADDR_LEN
man of inet_ntop says that INET_ADDR_LEN should not be less than
INET_ADDRSTRLEN and INET6_ADDRSTRLEN

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00
Pavel Tikhomirov
178692e7b2 net/sysctl: silence read error in case of CTL_FLAGS_READ_EIO_SKIP
Because stable_secret sysctl c/r produces a lot of spam error messages
in tests: https://github.com/xemul/criu/issues/160 But EIO for these
sysctl is valid behavior and no error need to be printed.

More general solution will also silence error messages for
sysctl_read_{u32,s32,u64}, but the flag CTL_FLAGS_READ_EIO_SKIP is
now used only for __CTL_STR and only for stable_secret so we can do
silence error only in sysctl_read_char.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Tested-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00
Andrew Vagin
5f9f130345 mount: add a missing return on a error path
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00
Andrew Vagin
d9e5684847 mount: add a comment to explain why do we need a clean mount
It's required when a target path is overmounted by one of child mounts.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00
Cyrill Gorcunov
7bd2270fdb cgroup: Fix early update of @dir_name in rewrite_cgsets
When we're walking over controllers and their directories
we should update the directory at the very end because
otherwise we will not match the rest of them once variable
is updated.

So I desided to simply rewrite the helper. Hopefully it
is more clear now.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:39:01 +03:00