vzmigrate: don't run vzfsync if there is no need
In case of ploop-based container migration, if there are no snapshots,
there is no need to call vzfsync as there are no images that rsync
copied (i.e. there is only a top delta, which is transferred by ploop
copy). Therefore, vzfsync is called with zero file arguments, giving
this error:
Calling vzfsync on ploop deltas
Usage: vzfsync {-s|-d} [-n] file [file ...]
-s, --sync do fsync()
-d, --datasync do fdatasync()
-n, --dontneed do fadvise(DONTNEED)
To fix, let's get the list of deltas to sync first, and only run vzfsync
if the list is not empty.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed