OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
a9552371084Released vzctl 4.3.1Changes: see http://openvz.org/Download/vzctl/4.3.1/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
86d3cf47454vzctl 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 KolyshkinKir Kolyshkin
94c960ca5d2vzctl.spec: add vps-rst-env scriptThis is an addition to commit 8a1e2d9. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
39de72d8b8cvzctl_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 KolyshkinKir Kolyshkin
c4d8a7d00dbman/*: fix dates with check-man-datesSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
beb250eaa2eman/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 KolyshkinKir Kolyshkin
7c097e15be1man/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 KolyshkinKir Kolyshkin
e51647ebfd3src/vzctl.c: fix copyright yearsIn both --usage and source file header. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
76a9dcfcb14ct: 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 VaginKir KolyshkinAndrey Vagin
8a1e2d945fbvzctl: 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 KolyshkinKir Kolyshkin
4eeffe85fd6vzctl 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 VaginKir KolyshkinAndrey Vagin
557abfef463cpt: 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 VaginKir KolyshkinAndrey Vagin
4fdbcb51f5bAdd 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 VaginKir KolyshkinAndrey Vagin
20bd872517bvzctl: 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 KolyshkinKir Kolyshkin
11b3875666avzctl_env_switch_snapshot(): reworkUse ploop_switch_snapshot_ex(). Some fixes here and there. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
02401118f41vzctl_env_create_snapshot(): specify guid on rollbackIt's better to specify guid explicitly on rollback. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
81027baf1d7vzctl_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 KolyshkinKir Kolyshkin
72d33f045ce[style] src/snapshot*.c: comma after GET_SNAPSHOT_XMLFor consistency Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0e127f21122src/snapshot.c: log errno after failed renameSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3b504dc5d4fvzctl 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 KolyshkinKir Kolyshkin
971dc84c93avzctl 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 KolyshkinKir Kolyshkin
939a31c03ebstat_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 KolyshkinKir Kolyshkin
0e0890a4038stat_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 KolyshkinKir Kolyshkin
134e62b1388show_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 KolyshkinKir Kolyshkin
b48090d5058is_vzquota_available(): check for x bitUse access() to check if vzquota binary is executable. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ab67595298eMacro 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 KolyshkinKir Kolyshkin
5ec8737cc5bvzctl 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 KolyshkinKir Kolyshkin
de45de523f5logger(): don't spoil errnoSave and restore errno, so using logger() won't change it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
eafb00e9c7dstat_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 KolyshkinKir Kolyshkin
d03a9b1ea90vps_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 KolyshkinKir Kolyshkin
0f5a800cd53vzctl 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 KolyshkinKir Kolyshkin
201820f0cacvzctl 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 KolyshkinKir Kolyshkin
0906cb700a5configure.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 KolyshkinKir Kolyshkin
20bdfe3bbf7vzmigrate: 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 KolyshkinKir Kolyshkin
78adeb7dba7vzctl.spec: add forgotten 4.3 changelogBetter late than never?.. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a34719871dfReleased vzctl 4.3Changes: see http://openvz.org/Download/vzctl/4.3/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
869f2a533a6ct_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 KolyshkinKir Kolyshkin
78af7f6ffbccheck_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 KolyshkinKir Kolyshkin
944aaef6d18ct_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 KolyshkinKir 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 KolyshkinKir Kolyshkin
6800818116escripts/.gitignore: add vps-cpt, vps-rstThis is an addition to commit 19d8435 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Simon BouletKir KolyshkinSimon Boulet
b0b44baa374Do 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 BouletKir KolyshkinSimon Boulet
fd75c37e24dMove container private area check after executing premount scriptsSigned-off-by: Simon Boulet <simon@nostalgeek.com>
Kir KolyshkinKir Kolyshkin
9512a11a4cfFix "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 KolyshkinKir Kolyshkin
78b5f53243fFix 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 KolyshkinKir 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 KolyshkinKir Kolyshkin
ed0a41eb3b9ct_chkpnt, ct_env_restore(): free env[]Be green, save whales, free the mallocs! Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
784b2caf5a4ct_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 KolyshkinKir Kolyshkin
afab8fc5daascripts/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 VaginKir KolyshkinAndrey Vagin
19d84358661vzctl: 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>