OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
07805261620Released vzctl-3.0.29CHANGES (since 3.0.28.3) New features * vzctl set --ipadd: support for net masks (#1088) * vzsplit: support for VSwap enabled config generation Fixes * vzctl set --ipadd: fix default route disappearing in Debian-based containers after adding netmask (#1971) * configs: fix VSwap configurations * vzctl set/start: fix parsing T suffix on 32-bit boxes * vzctl set --d...
Kir KolyshkinKir Kolyshkin
6fd6b71bf1evzlist: fix .index for uptime and ioprioSet .index for "uptime" and "iolimit" fields to 0. It's unused by the corresponding formatters for the current vzlist output, but it will be used by a later patches. Reported-by: Roman Kagan <rkagan@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3c86631caccFix default route disappearing in Debian-based containersLet's take a Debian 6 CT with a network setup similar to this: cat /etc/network/interfaces # Auto generated lo interface auto lo iface lo inet loopback # Auto generated venet0 interface auto venet0 iface venet0 inet manual up ifconfig venet0 up up ifconfig venet0 0 up route add default dev venet0 down route del default dev venet0 down ifconfig venet0 down iface venet0 inet6...
Kir KolyshkinKir Kolyshkin
42b34bf8839bin/vzubc: fix -i/-r modes for 0th beancounterProblem: # ./vzubc -i -c -r -q 0 Error: can not use relative/incremental modes: BCID is unknown Cause: commit 50c173f4871e Solution: fix check for bcid to be less than zero, initialize bcid to -1 at BEGIN. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1bc4e8a2064bin/vzubc: fix for Debian/mawkDebian systems use mawk not gawk by default. Apparently, mawk lacks strtonum() function. We could just truncate the last character (which is ':'), but let's be lazy and use int() function which appears to be portable. Reported-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ba6d94480a4scripts/vps-*: support for IPs with netmasksNow when vzctl supports venet IPs with netmasks (commit f018af5fa and others), we need to strip those masks from IP_ADDR list before dealing with it. http://bugzilla.openvz.org/1088 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
00f3681e63cscripts/vps-net_add.in: fix VE_STATE descriptionWhen running this script, VE_STATE can either be 'starting' or 'running'. State 'stopping' only makes sense for vps-net_del script. Fix a minor whitespace issue while at it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b7c58268392vzctl set --ipadd: fix for adding existing IP with different netmaskIf we are adding an IP, and the same IP is already in config (possibly with different netmask), add the IP from config to 'del' list (as if a user specified --ipdel). It will cause the from-config IP to be deleted and the from-command-line IP to be added. This makes most sense if netmask has changed, but even if it is the same, that kinda means "re-add this IP". This patch relies on previous c...
Kir KolyshkinKir Kolyshkin
e25558b2035vzctl set: fix exit code in case of invalid veth paramsReturn code from check_veth_param() is used as vzctl exit code: main() run_action() set() check_veth_param() So do return VZ_INVALID_PARAMETER_SYNTAX instead of -1. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c81b8fd6278src/lib/env.c: fix logging features maskWhen trying to compile vzctl with clang 2.8, got this: CC env.lo env.c:344:38: warning: length modifier 'L' results in undefined behavior or no effect with 'x' conversion specifier [-Wformat] logger(3, 0, "Set features mask %016Lx/%016Lx", ~~~~^~ env.c:344:45: warning: length modifier 'L' results in undefined behavior or no ef...
Kir KolyshkinKir Kolyshkin
3249c0d4201__merge_str_list(): 'add' list have a precedence over 'del'Consider the following command: vzctl set --ipdel 1.2.3.4 --ipadd 1.2.3.4 Before this patch, this does nothing. Now, we are adding values from the 'add' list even if they are in the 'del' list, thus forcing the command to remove the IP and add it again. This totally makes sense, provided we remove IPs first and then add those (need to check it). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
372080ff61betc/init.d/vz*: mount cgroupsNewer RHEL6-based kernels provides some information in /proc/vz/beancounter /proc/vz/container /proc/vz/fairsched but it needs to be mounted. Make sure init script takes care about this. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9a8350a4b91setver.sh: do not hardcore configure.ac and vzctl.specSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
f319aef1d91Add SETFCAP to default capabilities in CTIn Fedora 15 some applications use file capabilities instead of suid bit, so file capabilities should be supported in CT. I checked this patch works with rhel5 kernel, because nobody worries about absent capability with number 31. http://bugzilla.openvz.org/1911 Signed-off-by: Andrey Vagin <avagin@openvz.org>
Kir KolyshkinKir Kolyshkin
382f306cd08etc/dists/scripts/{set_*,postcreate}.sh: de-bash-ifyThere is nothing bash-specific in these scripts, so make them executed by /bin/sh. Well, the true story is these scripts are read by vzctl and executed by running /bin/bash and then /bin/sh inside a container, when writing the 'functions' file and then the script contents to shell's stdin. So, these '#!/bin/whatever' does not really matter, and if bash is available it will be used since it is ...
Tim SmallKir KolyshkinTim Small
77c13606b08etc/dists/scripts/postcreate.sh: randomize /etc/cron.d entries, tooApparently modern cron daemons are not limited by /etc/crontab, there can also be some stuff at /etc/cron.d which we should also randomize. [kir@openvz.org: fix 'return 0' on no file found] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636463 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a86beacde8cetc/dists/scripts/deb*: de-bash-ifyMost of this is written in pure shell, so let's make it runnable by dash and busybox sh. Slightly checked on Debian 6 with dash using set --ipadd/--ipdel commands. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f83b28435f5etc/dists/scripts/functions: remove bashismsInterestingly, all this stuff is pure shell, except for 'function' keyword before function declarations. So let it be pure /bin/sh. Slightly tested with dash and busybox sh. While at it, also remove an unneeded semicolon. Reported-by: Sam Trenholme <strenholme.usenet@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
07d74e734feetc/dists/scripts/debian-del_ip.sh: fix a typoCommit 57842cb82 introduced a non-closed quote. Fix it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ee190993f53vzifup-post: do not fail if there's no /proc/vz/veipIn some situations (some of OpenVZ modules are loaded, some are not) we can have this: # vzifup-post eth0 awk: cmd. line:1: fatal: cannot open file `/proc/vz/veip' for reading (No such file or directory) Fix it by changing a check for /proc/vz/veinfo to /proc/vz/veip. Naturally, we don't care about veinfo, and we should not do anything if veip is not here. http://bugzilla.openvz.org/1918...
Kir KolyshkinKir Kolyshkin
ffa43535c79src/lib/config.c: move devperm2str() to after parse_dev_perm()Pure cosmetic change: two functions have similar meaning and so should be close to each other in the source file. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a91482976b3man/vzctl.8: use simfs in mount script exampleApparently bind mounts are not safe wrt checkpointing, i.e. if a filesystem being bind-mounted is not recognized by kernel checkpointing code (say, xfs is not in the list), then checkpointing will fail. To avoid this problem, use simfs instead of bind mount. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4a0dd880a2fetc/dists/scripts/functions: fix a typoThe typo was introduced by commit 30d0cf8d. http://bugzilla.openvz.org/1088 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
554fd1673fevzctl set --devices|--devnodes: do not allow to enable loop devices in CTError out when trying to assign /dev/loop* into a CT. OpenVZ kernels do not support loop devices inside a CT. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f231b2b4fcfvzctl set --devices: option argument parsing fixesHere is one important fix, plus a number of improvements for parse_devices_arg(). (1) FIX parsing "permissions" (i.e. the last) parameter. Before this patch, documented value 'none' was not really recognized properly because string size was 3 (i.e. for up to 2 characters and a '\0' byte). Now, use size of 6 (up to 5 characters and a '\0' byte) to allow for values like 'none...
Kir KolyshkinKir Kolyshkin
287cc9d96b2parse_devices_str(): fix returning error codes(1) Fix returning an error if parse_dev_perm() failed (2) Change 1 to -1 (pure cosmetic) (3) No need for 'int ret', remove it Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3502d2b92d6setver.sh: fix spec releaseApparently, according to RPM, version 3.0.28.3-1 > 3.0.28.3-git*. It makes it impossible to upgrade from stable to nightly. Fix it by having a number of commits since the last tag as a first part of the release. In other words WAS: 3.0.28.3-git.57.30d0cf8 NOW: 3.0.28.3-57.git.30d0cf8 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
30d0cf8d761vzctl set --ipadd: treat IPs with different masks as the same oneIntroduce merge_ip_list() which is the same as merge_str_list(), only using find_ip() instead of find_str() for checking IP addresses. Since find_ip tries not to look at netmask (commit 0f8c65271), we will not have same IPs with different masks in the resulting list. Also, due to commit e3d0346df new values have precedence over the old ones, so --ipadd can be used to change the mask of the alr...
Kir KolyshkinKir Kolyshkin
e3d0346df31src/lib/list.c: __merge_str_list(): re-prioritize listBefore this commit, values were added from the 'old' list, then from the 'add' list (provided they were not already added before). Now, values from the 'add' list takes precedence over the values from the 'old' list. In other words, values from the 'old' list are not added if the same values are to be added from the 'add' list. Should not have any visible effect per se, other than putting the...
Kir KolyshkinKir Kolyshkin
2f673243191src/lib/list.c: merge_str_list() generalizationMake generalized __merge_str_list() with an additional find_fn argument. This enables using function other than find_str() to check if the value is already in the list. Make merge_str_list() calling __merge_str_list with find_str as a last argument. Should not have any visible effect per se. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9f41f9263cesrc/lib/list.c: return NULL not 0Pure cosmetic stuff, NULL just looks better. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0f8c65271d9Rework find_ip() to work with netmasksWe want the same IP with different (optional) netmask to be found, i.e. we want to treat addresses 1.2.3.4, 1.2.3.4/16 and 1.2.3.4/32 as the same one. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d625152b356man/vzctl.8: add note that ipaddr can have maskhttp://bugzilla.openvz.org/1088 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
57842cb8223etc/dists/scripts/*ip.sh: add IP mask supportCommit f018af5f added support for netmasks. This commit tries to modify all the *-add_ip.sh and *-del_ip.sh scripts to understand the netmasks. There are definitely bugs in this code, as well as some previous bugs in the modified scripts. I guess it needs lots of testing and fixing, but let's get this rock rolling! http://bugzilla.openvz.org/1088 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6fd51be9ddbetc/dists/scripts/funtoo-add_ip.sh: do not hardcode venet0Use $VENET_DEV Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
17b4b085e08etc/dists/scripts/suse-add_ip.sh: declare 'found' as localSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8927b4880a6etc/dists/scripts/debian*add_ip.sh: remove unused variableSeems like 'found' was left alone after some code was moved to get_free_aliasid(). Remove it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
955b285b63aetc/dists/scripts/arch-add_ip.sh: do not hardcode venet0Use ${VENET_DEV} Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
bc67e660b0fparse_int(), parse_ul(): improvementsparse_int(): (1) do not truncate the result from long to int (for example, on 64-bit platform it will cause 4294967299 to be treated like 3, instead check for the value to be between INT_MIN and INT_MAX and return the error. (2) Since we check for INT_MIN/INT_MAX, there's no need to check for errno == ERANGE (and initialize errno). (3) no need to cast &tail to char** (4) do not change *...
Kir KolyshkinKir Kolyshkin
f018af5faa1vzctl set --ipadd/--ipdel: add ability to specify netmasksThis is a preliminary support for specifying netmasks for venet. It allows to specify a netmask in CIDR notation for IPv4 and IPv6 addresses. Same IP address with a different netmask is considered to be a separate IP. This is a work in progress, the next steps are: * modify all etc/dists/scripts/*{add,del}_ip.sh to understand IP_ADDR with netmasks (quite a lot of work) * document it in vzct...
Kir KolyshkinKir Kolyshkin
89b89402f17etc/dists/scripts/funtoo-add_ip.sh: fix error() useFunction error() expects two arguments, with the second one being the exit code. While at it, also (1) remove the '.' from the error message (2) a whitespace fix Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8c22cfec4ddsrc/lib/util.c: introduce/use get_addr_family()Make the code more readable in a couple of places. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2639f661c21src/lib/config.c: fix capability parsing error messageIt was ugly and misleading, now it's fine and dandy and we do not repeat in twice in the code, thanks to a wonderful goto operator. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
06d6199f82dsrc/lib/*.c: avoid list_head_init() if unnecessarySpotted this in a few places: if a function returns (or errors out) before using a local list, there's no need to init that list. In such places, move list_init() to just before using the list, avoiding the unnecessary initialization. Should not have any visible effect whatsoever, except for 0.002ns improvements in a few paths :) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
39396031bc4man/vz.conf.5: make SYNOPSYS content bold...to be in line with ctid.conf(5) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7fccc245609man/vzcfgvalidate: improvements(1) Reformat SYNOPSYS using .SY/.OP/.YS (2) Use .B for options to simlify formatting Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d5620308d2eman/vzcalc.8: improvements(1) Use .SY/.OP./.YS to reformat SYNOPSYS (2) Use .TP/.B for DESCRIPTION (3) Put OPTIONS to after DESCRIPTION (4) Add 'Num. Proc' description Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a3619da6840man/ndsend.8: improvements(1) Use .SY/.YS for SYNOPSYS (2) Use .B for options formatting (simplify) (3) Use .TP/.B for exit code formatting. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
305bc443bf4man/vzeventd.8: improvements(1) Reformat SYNOPSYS using .SY/.OP/.YS (2) Put OPTIONS to after DESCRIPTION (3) Use .TP and .B to format OPTIONS and DESCRIPTION (4) Copyright years update Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c2284b84889man/ndsend.8: format EXAMPLES using .EX/.EESigned-off-by: Kir Kolyshkin <kir@openvz.org>