- 24 Oct, 2016 12 commits
-
-
Kir Kolyshkin authored
clang complains: > cmdlinenv00.c:35:11: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] > if (ret < 0) { > ~~~ ^ ~ The fix is to use ssize_t not size_t. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
clang complains: > apparmor.c:86:20: error: too many arguments in call to 'checkprofile' [-Werror] > if (checkprofile(0) == 0) > ~~~~~~~~~~~~ ^ Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
clang complains: > clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -iquote ../lib/arch/x86/include -I../lib rtc.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o rtc > rtc.c:50:7: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value] > if (labs(delta - 1000000 / TEST_HZ ) > 100000) { > ^ Declare delta as long. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
clang complains: > clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -iquote ../lib/arch/x86/include -I../lib groups.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o groups > groups.c:22:9: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] > if (ng < 0) { > ~~ ^ ~ Declare ng as int. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
clang complains: > clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -iquote ../lib/arch/x86/include -I../lib vdso01.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -lrt -o vdso01 > vdso01.c:305:6: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value > [-Werror,-Wabsolute-value] > if (abs(ts1.tv_sec - ts2.tv_sec) > TIME_DELTA_SEC) { > ^ > vdso01.c:305:6: note: use function 'labs' instead Let's use labs() indeed. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
When compiling with clang, it complains like this: > clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -iquote ../lib/arch/x86/include -I../lib inotify_system.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o inotify_system > inotify_system.c:323:50: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] > if ((common_desc.inot < 0) || (common_desc.file < 0) || \ > ~~~~~~~~~~~~~~~~ ^ ~ > inotify_system.c:324:21: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] > (common_desc.dir < 0) || (common_desc.link < 0)) { > ~~~~~~~~~~~~~~~ ^ ~ > inotify_system.c:324:47: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] > (common_desc.dir < 0) || (common_desc.link < 0)) { > ~~~~~~~~~~~~~~~~ ^ ~ > 3 errors generated. Indeed these fields are uint32_t. As they are used to store the results of inotify_init() and inotify_add_watch() function calls, the type should be int. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
clang complains a number of times on our inline asm code, like this: > fpu00.c:13:6: error: ambiguous instructions require an explicit suffix > (could be 'flds', 'fldl', or 'fldt') > "fld %0\n" > ^ > <inline asm>:1:2: note: instantiated into assembly here > fld -4(%rsp) > ^ As floats are used, the suffix should be 's' ("short", 32-bit, float). Add it where needed. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
CLang doesn't like explicit NULL pointer dereference: > zombie00.c:52:5: error: indirection of non-volatile null pointer will be > deleted, not trap [-Werror,-Wnull-dereference] > *(int *)NULL = 0; > ^~~~~~~~~~~~ > zombie00.c:52:5: note: consider using __builtin_trap() or qualifying > pointer with 'volatile' > 1 error generated. Apparently, we need to add volatile to make it happy. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
clang complains about an unused function: > clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 > -iquote ./arch/x86/include -c -o parseargs.o parseargs.c > parseargs.c:12:1: error: unused function '__check_help' > [-Werror,-Wunused-function] > TEST_OPTION(help, bool, "print help message and exit", 0); > ^ > ./zdtmtst.h:71:2: note: expanded from macro 'TEST_OPTION' > param_check_##type(name, &(name)); > \ > ^ > <scratch space>:46:1: note: expanded from here > param_check_bool > ^ > ./zdtmtst.h:84:35: note: expanded from macro 'param_check_bool' > #define param_check_bool(name, p) __param_check(name, p, int) > ^ > ./zdtmtst.h:78:22: note: expanded from macro '__param_check' > static inline type *__check_##name(void) { return(p); } > ^ > <scratch space>:47:1: note: expanded from here > __check_help > ^ > 1 error generated. > <builtin>: recipe for target 'parseargs.o' failed As far as I can tell, the functions __check_##name are generated in order to check the argument type by the compiler. For gcc, the "inline" keyword is enough to suppress the "unused function" warning even when -Wunused-function is used. For clang, it's not the case (see https://llvm.org/bugs/show_bug.cgi?id=22712). A way to "use" the function is to use its name as a pointer and cast it to void. This is what this patch does. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
Commit 308741d0 removes all calls to path_length(), but the function itself is still there. Now, clang complains that it is unused. Remove it. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
The following error is emitted by clang: > CC criu/filesystems.o > criu/filesystems.c:280:13: error: variable 'ret' is used uninitialized > whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] > } else if (bme->extension) { > ^~~~~~~~~~~~~~ > criu/filesystems.c:287:6: note: uninitialized use occurs here > if (ret > 0) { > ^~~ > criu/filesystems.c:280:9: note: remove the 'if' if its condition is > always true > } else if (bme->extension) { > ^~~~~~~~~~~~~~~~~~~~ > criu/filesystems.c:272:9: note: initialize the variable 'ret' to silence > this warning > int ret; > ^ > = 0 > 1 error generated. This code was a result of commit 398e7d3. If we look closely, this is a false alarm, as "else if (bme->extension)" is always true as it was checked before. But this is not very clear, and the issue with clangs still needs to be fixed. There are many ways to do so: 1. Initialize ret to 0. This is what initial version of this patch did. 2. Remove the always-true condition, like this: - } else if (bme->extension) { + } else { In my opinion this would hurt readability. 3. Change the code flow, improving readability at the same time. I believe that #3 is what this patch does. In addition, it fixes handling of a few corner cases: - an overflow in snprintf(); - a case when bme->name is NULL (as it is used for strlen/snprintf, there is a potential for SIGSEGV); - a case of ret == 0 (currently there is no code flow that results in ret being 0, so it's just for the future). [v2: use linux kernel style for 'else' after a block] [xemul: Fix // comments ] Cc: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Adrian Reber authored
Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 17 Oct, 2016 1 commit
-
-
Pavel Emelyanov authored
Not a lot this time, just a bunch of bugfixes and improvements. A lot has happened in -dev branch around compel, hopefully the next release will have it. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 14 Oct, 2016 1 commit
-
-
Andrei Vagin authored
It's typo fix. MS_STRICTATIME has to be added to other flags there. travis-ci: success for mount: don't overwrite mount flags by MS_STRICTATIME Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 13 Oct, 2016 14 commits
-
-
Tycho Andersen authored
In particular, if the thing in criu's namespace is also a slave of something in an external mount namespace (as it is in the tests), we won't see the master, just the external slave. However, this also counts as an "external master" because it is an external bind mount, just from something that was itself a slave. I'm not sure why the test broke, but it works on ubuntu 16.04 and fails on 16.10, so I suppose something with the debugfs mount configuration has changed. I can look into it more if we're curious, but this patch fixes it and should probably go in anyway. Closes #223 travis-ci: success for mnt: allow external slaves too Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Currently a buffer is allocated on stack and its size is 1024. Usually we use our static buffer to read proc files and its size is 4096 (page size). I know that this patch doesn't fix this problem completly, it just does it less critical. https://github.com/opencontainers/runc/issues/1070 travis-ci: success for proc_parse: use the static buffer to parse mountinfo Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
[root@fc24 criu]# python test/zdtm.py run -t zdtm/transition/shmem --pre 3 === Run 1/1 ================ ======================== Run zdtm/transition/shmem in h ======================== cc -g -O2 -Wall -Werror -fno-strict-aliasing -iquote ../lib/arch/x86/include -I../lib shmem.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o shmem Start test ./shmem --pidfile=shmem.pid --outfile=shmem.out Run criu pre-dump Run criu pre-dump Run criu pre-dump Run criu dump Run criu restore Send the 15 signal to 33 Wait for zdtm/transition/shmem(33) to die for 0.100000 Test output: ================================ 15:12:25.444: 33: FAIL: shmem.c:70: checksum mismatch: ea71000 109c9000 Cc: Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Only real pid is used internally now. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Localize the processes_to_wait calculations in seize.c. In order to distinguish dead tasks which has already been wait()-ed from dead tasks that hasn't introduce internal 'zombie' state for seize_wait_task(). Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Don't do comparisons of creds insize core seizing routine. Instead, pull the creds on the caller's stack and compare them there if required. At the same time more the proc_status_creds_dumpable() to the place where it's only needed and make it static. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Laurent Dufour authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> [ldufour@linux.vnet.ibm.com: mostly rewrite to fix functional issue] Signed-off-by:
Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by:
Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Laurent Dufour authored
Signed-off-by:
Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Reviewed-by:
Christopher Covington <cov@codeaurora.org>
-
Andrei Vagin authored
We are going to use this script for testing linux-next. v2: remove bashism travis-ci: success for scripts: allow to skip travis specific parts in travis-tests (rev2) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
>From https://lwn.net/Articles/428176/: "CLOCK_BOOTTIME is identical to CLOCK_MONOTONIC, except it also includes any time spent in suspend (as currently measured by read_persistent_clock()). This allows applications to get a suspend aware monotonic clock." So, I *think* all we have to do is allow the constant, because the only handling that is different is how the kernel tracks the time. The motivation for adding this is that new versions of systemd-resolved (like what will ship in ubuntu 16.10) seems to open a BOOTTIME fd. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> CC: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
but let's keep it during restore, since there might be images around that were generated before we did this check at dump. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> CC: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 10 Oct, 2016 12 commits
-
-
Pavel Emelyanov authored
The parasite_prep_ctl() will become compel call, so it won't have the code that scans CRIU's vma area list. For pure compel users we'll need to add simple /proc/maps scanner that'd find the entry point. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
travis-ci: success for handle-elf.c: whitespace cleanup Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
with newer versions of protobuf, I get: ./crit Traceback (most recent call last): File "./crit", line 7, in <module> import pycriu File "/home/ubuntu/criu/crit/pycriu/__init__.py", line 2, in <module> import images File "/home/ubuntu/criu/crit/pycriu/images/__init__.py", line 2, in <module> from images import * File "/home/ubuntu/criu/crit/pycriu/images/images.py", line 52, in <module> from pb import * File "/home/ubuntu/criu/crit/pycriu/images/pb.py", line 35, in <module> from packet_sock_pb2 import * File "/home/ubuntu/criu/crit/pycriu/images/packet_sock_pb2.py", line 18, in <module> import sk_opts_pb2 as sk__opts__pb2 File "/home/ubuntu/criu/crit/pycriu/images/sk_opts_pb2.py", line 23, in <module> serialized_pb=_b('\n\rsk-opts.proto\"\xe2\x02\n\rsk_opts_entry\x12\x11\n\tso_sndbuf\x18\x01 \x02(\r\x12\x11\n\tso_rcvbuf\x18\x02 \x02(\r\x12\x16\n\x0eso_snd_tmo_sec\x18\x03 \x02(\x04\x12\x17\n\x0fso_snd_tmo_usec\x18\x04 \x02(\x04\x12\x16\n\x0eso_rcv_tmo_sec\x18\x05 \x02(\x04\x12\x17\n\x0fso_rcv_tmo_usec\x18\x06 \x02(\x04\x12\x11\n\treuseaddr\x18\x07 \x01(\x08\x12\x13\n\x0bso_priority\x18\x08 \x01(\r\x12\x13\n\x0bso_rcvlowat\x18\t \x01(\r\x12\x0f\n\x07so_mark\x18\n \x01(\r\x12\x13\n\x0bso_passcred\x18\x0b \x01(\x08\x12\x12\n\nso_passsec\x18\x0c \x01(\x08\x12\x14\n\x0cso_dontroute\x18\r \x01(\x08\x12\x13\n\x0bso_no_check\x18\x0e \x01(\x08\x12\x14\n\x0cso_bound_dev\x18\x0f \x01(\t\x12\x11\n\tso_filter\x18\x10 \x03(\x06*6\n\x0bsk_shutdown\x12\x08\n\x04NONE\x10\x00\x12\x08\n\x04READ\x10\x01\x12\t\n\x05WRITE\x10\x02\x12\x08\n\x04\x42OTH\x10\x03') File "/usr/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 827, in __new__ return _message.default_pool.AddSerializedFile(serialized_pb) TypeError: Couldn't build proto file into descriptor pool! Invalid proto descriptor for file "sk-opts.proto": NONE: "NONE" is already defined in file "rpc.proto". NONE: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it. Therefore, "NONE" must be unique within the global scope, not just within "sk_shutdown". this fixes that. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> CC: Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
In another "how did this ever work" moment, sometimes this wasn't set and we didn't propagate the LSM. Let's set it :) Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
avoids: [libprotobuf WARNING google/protobuf/compiler/parser.cc:547] No syntax specified for the proto file: autofs.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
Unfortunately, newer versions of protobuf check that the file suffix ends in _pb2.py: sudo ./zdtm.py run -t zdtm/static/apparmor_stacking Traceback (most recent call last): File "./zdtm.py", line 23, in <module> import criu as crpc File "/home/ubuntu/criu/test/criu.py", line 12, in <module> import rpc File "/home/ubuntu/criu/test/rpc.py", line 36, in <module> type=None), File "/usr/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 652, in __new__ _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors should not be created directly, but only retrieved from their parent. v2: fix up the clean target, and remove some comments that were about the old rename Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> CC: Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Stanislav Kinsburskiy authored
This helper uses other binaries (like awk), which can fail or be killed. It this case might be, that no mountpoint is found. Or, on other hand, the whole mount point path is wrong, and is absend in mountinfo. Return explicit error in this case. Without this patch, script will proceed further, and, since returned value is empty, it doesn't equal to "autofs", so script will try to bind-mount autofs mount, resulting in hung. travis-ci: success for systemd-autofs-restart.sh: explicitly return result from get_fs_type Signed-off-by:
Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Stanislav Kinsburskiy authored
This is minor issue, but would be nice to have print in sync with actual action. travis-ci: success for mount: fix error print in case of failed bind-mount Signed-off-by:
Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
The 'umount2: umount2' doesn't make sense as it's a circular dependency. It came from commit e7b152fd and probably meant to say "umount2: umount2.c" instead. But it's not needed either as make has implicit rules like that. Drop the "zdtm_ct: zdtm_ct.c" for same reason. travis-ci: success for test/Makefile: rm bad code Cc: Andrei Vagin <avagin@openvz.org> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
The "$(SRC): $(FOOTER)" dependency listed is incorrect, as criu.txt file is not dependent on footer.txt. Having said that, criu.8 in fact do depend on footer.txt but that was not reflected in Makefile. Fix it. While at it, add the custom.xsl dependency, which was also missing. Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
I just discovered that if I run make right from Documentation/ subdir, CRIU_VERSION is not defined so the generated man page is lacking it. Let's fix by conditionally including ../Makefile.versions. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
Since commit e6dcf46 there is no need to specify the default goal explicitly. The common convention for Makefiles is the first goal in the file is the default one, so most universally there's "all:" goal at the beginning. Let's adhere to this convention, moving the "all:" up where it is to be expected. [v2: keep the DEFAULT_GOAL for clarity] Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-