set(): don't leak dist_name

Reported by Coverity, CID 1202520

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
get_osrelease(): free dist

Reported by Coverity, CID 1202523.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
ct_chkpnt(): don't leak dumpfile

Allocate it on stack instead.

Reported by Coverity, CID 1202526.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
ct_restore_fn(): free dumpfile, statefile

Reported by Coverity, CID 1202524, 1202525.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
src/vzmemcheck.c: don't leak fd

Reported by Coverity, CID 1202522.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzlist: don't do extra strdup()

Memory returned by list2str() is already allocated.

Reported by Coverity, CID 1202519.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
get_running_ve_list(): don't leak mem

Reported by Coverity, CID 1202521.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzmemcheck: don't leak velist

This is required after commit dfd699a.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
cpumask: allow for up to 4096 CPUs

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
config.c: get rid of parse_cpumask/store_cpumask wrappers

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
cpu.h: get rid of cpumask_bits macro

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl --help: fix iolimit

It should be in square brackets

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl(8): fix a typo

Introduced in commit 3fc3f7a.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vz_setcpu(): don't ignore errors from set_cpu*

Not sure why it was written that way, but errors from set_cpu*()
were just ignored. Fix it, returning an error as soon as we have one.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
get_running_ve_list(): close fp on error

Reported by Coverity, CID 1202535.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzlist: don't complain about missing ploop-lib

Commit d1176e70037 introduced a way to silence ploop lib
for vzlist, since in vzlist we don't want to see anything
on stdout. The problem with that commit is it unconditionally
calls is_ploop_supported() which tries to load ploop library
and complains if it is missing, even then it is not needed:

	[root@ce6 ~]# vzlist -a
	Can't load ploop library: libploop.so: cannot open shared object file:
	No such file or directory
	Please install ploop packages!
	      CTID      NPROC STATUS    IP_ADDR         HOSTNAME

Surely, we want to use ploop functions only when it is really
necessary (i.e. CT layout is ploop and diskspace/diskquota
parameters are requested).

So, let's move ploop.set_verbose_level() to get_ve_ploop_info().
This way, we will

1. Not get a "Can't load ploop library" error when it's not needed
2. Get the above error when ploop-lib is needed but can't be loaded
   (ploop diskspace/diskinodes are requested, no ploop-lib found).

https://bugzilla.openvz.org/2952

Signed-off-by: Kir Kolyshkin <kir@openvz.org>