vzmigrate: use ploop with feedback if possible
ploop copy added support for more effective copy procedure, when the
sending side waits for completion of fsync() on receiving side before
suspending a container. This feature requires a "feedback" channel
from the receiving side back to sending side, such as a bi-directional
pipe or a socket pair.
This commit implements such a channel using openssh port forwarding
(for security), socat tool (for listening on a tcp socket),
and built-in bash feature to connect a tcp socket to a file descriptor.
If support for feedback fd is not available remotely (older ploop tools
version), or it is not working for some other reason, vzmigrate
falls back to old style ploop copy.
Unfortunately, this commit also changes /bin/sh to /bin/bash shebang,
as a feature to redirect a tcp host:port to an fd is specific to bash.
socat could also be used here, but unfortunately there is no way
to get ploop copy status from it, so let's rely on bash for now.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2 files changed