vzmigrate: lock CT locally

Introduce proper CT locking so no other operation could be performed
on container while it is being migrated. Add appropriate error code
in case CT is already locked, and describe it in man page.

Note we take lock before checking CT status and release it at the very
end (or on error path). Hopefully, this will prevent bad situations from
happening (say vzctl snapshot running in parallel with vzmigrate).

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