Commits
Author | Commit | Message | Commit date | Issues | |
---|---|---|---|---|---|
Kir Kolyshkin | a9552371084 | Released vzctl 4.3.1Changes: see http://openvz.org/Download/vzctl/4.3.1/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 86d3cf47454 | vzctl restore: fix splitted error messageWhen restore fails on vz kernel, we have errors printed from both parent and child, and they are sometimes intermixed together in a bad way. So let's print undump error in one place. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 94c960ca5d2 | vzctl.spec: add vps-rst-env scriptThis is an addition to commit 8a1e2d9. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 39de72d8b8c | vzctl_env_switch_snapshot(): rm const castsSince ploop 1.7 we don't have to do that. Up ploop requirements in spec accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | c4d8a7d00db | man/*: fix dates with check-man-datesSigned-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | beb250eaa2e | man/Makefile.am: fix check-man-dates targetThe problem was man pages like vz.conf and ctid.conf were not processed properly because of the dot in the middle of the name. Modify sed expresson accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 7c097e15be1 | man/Makefile: fix check-man-dates target wrt vzctlIn vzctl we don't have .TH as the first line of the file, so we need to modify sed expression accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | e51647ebfd3 | src/vzctl.c: fix copyright yearsIn both --usage and source file header. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Andrey Vagin | 76a9dcfcb14 | ct: return positive error code from ct_env_create_real and ct_restore_fnThe most part of vzctl functions return positive error code. This two functions were exceptions, because they return PID of init to create netns file. Currently each of these functions creates netns file by itself. [kir@: fixed one last case of return -VZ_*] Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Andrey Vagin | 8a1e2d945fb | vzctl: synchronize CRIU with vzctl (v2)vzctl provides two descriptors signalfd and waitfd, it's used for apply host-side configuration after creating environment. A signal is send to signalfd after creating environment and an answer is recieved from waitfd. v2: fix comments from Kir Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 4eeffe85fd6 | vzctl start/destroy: fix criu dump removalIn case we do checkpointing via criu, our "dumpfile" is actually a directory and we need to remove it recursively. 1 Fix destroy_dumpfile() accordingly 2 Rename to destroy_dump() 3 Use it from vps_start() Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Andrey Vagin | 557abfef463 | cpt: restore veth devices with correct names (v4)transmit pair of veth names to criu via the option --veth-pair v2: unset IFS and delete eval from vps-rst v3: fix comments from Kir v4: vzcheckvar VE_VETH_DEVS Signed-off-by: Andrey Vagin <avagin@openvz.org> | |||
Andrey Vagin | 4fdbcb51f5b | Add ability to skip creation of veth devicesIt will be used for resuming CT with help CRIU. CRIU restores veth devices and configures them inside CT, so vzctl should configures them on the host side. [kir@: ported to latest git] Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Andrey Vagin | 20bd872517b | vzctl: pass vps_res in env_create_FN[kir@: fix ct_restore_fn() argument] Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 11b3875666a | vzctl_env_switch_snapshot(): reworkUse ploop_switch_snapshot_ex(). Some fixes here and there. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 02401118f41 | vzctl_env_create_snapshot(): specify guid on rollbackIt's better to specify guid explicitly on rollback. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 81027baf1d7 | vzctl_env_[u]mount_snapshot: rm guid checkThere is no need to check for guid being non-NULL, it is already checked in parse_snapshot_*_opt(). Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 72d33f045ce | [style] src/snapshot*.c: comma after GET_SNAPSHOT_XMLFor consistency Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 0e127f21122 | src/snapshot.c: log errno after failed renameSigned-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 3b504dc5d4f | vzctl snapshot-switch: don't remove dump fileUsually, after successful restore from a dumpfile, the dumpfile is removed since the CT is started, the file system is changed and the dumpfile is no longer in a state consistent with file system. This is the way it works since commit aec4998. There should be one exception though. When ploop snapshots are used, we do have consistent filesystem state and can return to it many times, so we shoul... | |||
Kir Kolyshkin | 971dc84c93a | vzctl create: umount ploop device if interruptedIn case we got interrupted while creating ploop CT, employ cleanup mechanism to umount ploop image. Otherwise (i.e. without this patch) interrupted vzctl create leaves a directory under /vz/vztmp and a stalled vzctl process which tries to delete this directory but can not since it contains an image used by in-kernel ploop device that can't be removed. Signed-off-by: Kir Kolyshkin <kir@openvz.... | |||
Kir Kolyshkin | 939a31c03eb | stat_file(): use access()Function stat() was used to check if file is available. It is an overkill. Let's just use access(file, F_OK) instead. Also, simplify the code while we're at it. Now, function name (stat_file) becomes somewhat strange, but let's leave it as it for now. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 0e0890a4038 | stat_file(): fix usagestat_file() does not return a boolean, instead it can be 0, 1 or -1. So we need to explicitly check for 1 in most of the cases. Fix all cases in which we treated stat_file() return as boolean. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 134e62b1388 | show_status(): refactorInstead of using if statements, just assign a result of condition to a variable. While at it, fix using stat_file() by explicitly checking for 1. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | b48090d5058 | is_vzquota_available(): check for x bitUse access() to check if vzquota binary is executable. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | ab67595298e | Macro GET_DUMP_FILE is internal, move to .cThis is a fix to commit e51e3af, which for some reason moved very internal and somewhat ugly macro GET_DUMP_FILE to include/cpt.h file. Move it back to .c where it belongs, and add #undef after its last use. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 5ec8737cc5b | vzctl snapshot-switch: reread saved configThis is a fix to commit dbd1283 which didn't work at all because of this. Test case (on an SMP box!): # vzctl exec $CTID grep -cw processor /proc/cpuinfo N (where N > 1) # vzctl snapshot $CTID Creating snapshot {some-id} ... Snapshot {some-id} has been successfully created # vzctl set $CTID --cpus 1 --save # vzctl exec $CTID grep -cw processor /proc/cpuinfo 1 # vzctl snapshot-swi... | |||
Kir Kolyshkin | de45de523f5 | logger(): don't spoil errnoSave and restore errno, so using logger() won't change it. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | eafb00e9c7d | stat_file(): print errorIn case we can't stat file for the reason other than ENOENT, print an appropriate warning. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | d03a9b1ea90 | vps_start_custom(): close old_wait_p fdsCommit c4fd52f introduced old_wait_p pair or fds, but it forgot to close them on error case and when exiting from vps_start_custom(). Fix it. Interestingly, this bug was NOT found/reported by Coverity. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 0f5a800cd53 | vzctl restore/start: fix running mount scriptWhen doing vzctl restore, we should still run mount script. Error was introduced in commits 784b2ca and 40ea0d5. Revert those. Instead, we check for fn != NULL in vps_start_custom to distinguish between start and restore. In case of restore, we do not run start script. https://bugzilla.openvz.org/2603 Reported-by: dippo4589@gmail.com Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 201820f0cac | vzctl stop: don't kill CT if halt returned errorSometimes CT's /sbin/halt returns an exit code of 1 but CT is still able to shut down. In such case, we should still wait for CT to shut down, and kill it forcibly only after a timeout. This is a fix to commit b7baef97. I was able to reproduce this behavior (halt returning 1) on a freshly started CentOS 5 system with CTs started on boot. Not able to reproduce it now though... Signed-off-by: ... | |||
Kir Kolyshkin | 0906cb700a5 | configure.ac: set _GNU_SOURCE for older autoconfMacro AC_USE_SYSTEM_EXTENSIONS is adding _GNU_SOURCE to CFLAGS (actually DEFS but it end up in compilation flags) so we don't have to do it in every file using GNU extensions. The problem is this macro is only available since autoconf 2.60, while RHEL5 have autoconf 2.59. Note that usually this is not an issue since distribution tarball already contains stuff generated by autoconf. This only h... | |||
Kir Kolyshkin | 20bdfe3bbf7 | vzmigrate: fix a typoIt lead to this message: /usr/sbin/vzmigrate: line 461: [: missing `]' Otherwise, fortunately, pretty harmless. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 78adeb7dba7 | vzctl.spec: add forgotten 4.3 changelogBetter late than never?.. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | a34719871df | Released vzctl 4.3Changes: see http://openvz.org/Download/vzctl/4.3/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 869f2a533a6 | ct_env_create_real(): don't use O_CLOEXECReplace O_CLOEXEC flag to open with a separate fcntl(FD_CLOEXEC) call, since otherwise we can't be compiled on older distros: hooks_ct.c: In function 'ct_env_create_real': hooks_ct.c:427: error: 'O_CLOEXEC' undeclared (first use in this function) hooks_ct.c:427: error: (Each undeclared identifier is reported only once hooks_ct.c:427: error: for each function it appears in.) Signed-off-by: Kir... | |||
Kir Kolyshkin | 78af7f6ffbc | check_local_ugid(): fix potential NULL dereferenceIndeed, we check uid || gid for non-NULL in if condition, but then dereference them both. Fix by using ?: operator. Reported by Coverity, CID 1025651. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 944aaef6d18 | ct_env_create_real(): don't use uninitialized varIn fact we do write() just to tell the other side it can proceed, so it's not important if what we write is initialized or not. But just to make Coverity happy, let's write 0. Also, while at it, declare the variable closer to its use, and rename it to something more neutral, since we don't mean any 'err' here. Reported by Coverity, CID 1025649 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | f9ee748d829 | _env_create(): don't pass -1 to closearg->userns_p can be -1, so check it before passing to close() Reported by Coverity, CID 1025650. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 6800818116e | scripts/.gitignore: add vps-cpt, vps-rstThis is an addition to commit 19d8435 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Simon Boulet | b0b44baa374 | Do not fail when private area does not exist[kir@openvz.org: formatting/whitespace nitpicks] Signed-off-by: Simon Boulet <simon@nostalgeek.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Simon Boulet | fd75c37e24d | Move container private area check after executing premount scriptsSigned-off-by: Simon Boulet <simon@nostalgeek.com> | |||
Kir Kolyshkin | 9512a11a4cf | Fix "premount/postumount script failed" errorsThis is a fix to commit eeceb72 Mentioned in a patch in https://bugzilla.openvz.org/2529 Reported-by: Simon Boulet <simon@nostalgeek.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 78b5f53243f | Fix checking vps_is_mounted() return valuevps_is_mounted() does not return boolean value, as it can return -1 in case of an error. Therefore, we should not treat it as such. Document vps_is_mounted() return values, and replace all places using this function as follows: if (vps_is_mounted()) -> if (vps_is_mounted() == 1) if (!vps_is_mounted()) -> if (vps_is_mounted() == 0) We still don't do any error processing, but it is already ... | |||
Kir Kolyshkin | 01365c9bc3f | [style] Rename ct_env_restore to ct_restore_fnJust to be in sync with restore_fn in hooks_vz.c Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | ed0a41eb3b9 | ct_chkpnt, ct_env_restore(): free env[]Be green, save whales, free the mallocs! Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 784b2caf5a4 | ct_restore(): pass SKIP_ACTION_SCRIPT to vps_create_customThis is the same fix as commit 40ea0d5, but for restoring upstream containers through criu. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | afab8fc5daa | scripts/vps-{cpt,rst}: nitpicksFix copyright years, trailing whitespace, tabs vs spaces, and English in some comments and error messages. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Andrey Vagin | 19d84358661 | vzctl: checkpoint/restoer of upstream CTsIt can be done by any third party tools. sripts/ct-cpt and script/ct_rst are executed to dump and restore CT This patch adds scripts for CRIU. v2: add the GPL header and descriptions in scripts describe and check variables in scripts Signed-off-by: Andrey Vagin <avagin@openvz.org> |