vzctl create --diskinodes: check for max ploop size

Use the ploop_get_max_size to check if the value of --diskinodes
given is too high, and if yes suggest what the maximum value is.

Note it requires ploop library 1.12 or greater, but should work
with older library, as it checks that the function pointer is non-NULL.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzmigrate: don't use rsync --delete-excluded

Options "--exclude $TOP_DELTA --delete-excluded" were used for rsync
in case of migration with ploop-copy in order to delete the top delta
so that ploop copy receive don't stumble (it does not overwrite
existing files).

Unfortunately, this makes it unable to pass some other arbitrary
--exclude options to rsync in case there is a need to say "skip those
files, they are already there" to rsync.

So, remove --delete-excluded, and make sure to run rm -f $TOP_DELTA
on destination just before starting ploop copy.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Fix PARAM_* values collision

Oops, PARAM_SNAPSHOT_SKIP_CONFIG has the same value as
PARAM_SKIP_UMOUNT. While not a problem as these can't
be used together, better fix it.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl snapshot-switch: add --must-restore

It has been pointed out to me that snapshot-switch ignores the failure
to restore a CT from a dump file. Also, not every snapshot contains a
dump file, so it's not clear whether we will have a running or stopped
container after this operation.

Introduce --must-restore flag to eliminate such uncertainty -- if it is
set, a dump file is required (i.e. its absense is treated as an error
rather than ignored), and a sucessful restore/resume is also required
(i.e. the failure to restore is treated as an error rather than warning).

Man page modified accordingly.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl snapshot-switch: improve an error message

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl snapshot-switch --must-restore: rollback config on error

With --must-restore, we are rolling back all the changes if restore fails.
The only problem is we are not restoring back CT config. Let's do that.

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