[CRIU] [PATCH p.haul 2/3] p.haul: minor functions reordering in Virtuozzo hauler
Nikita Spiridonov
nspiridonov at virtuozzo.com
Tue Jun 21 02:29:13 PDT 2016
Move __parse_fdfs_arg function of Virtuozzo hauler to the bottom of
the class to improve readability a bit.
Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
---
phaul/p_haul_vz.py | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index cb87574..8a5b296 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -269,28 +269,6 @@ class p_haul_type:
deltas = self.__parse_fdfs_arg(fdfs)
return fs_haul_ploop.p_haul_fs_receiver(deltas)
- def __parse_fdfs_arg(self, fdfs):
- """
- Parse string containing list of ploop deltas with socket fds
-
- String contain list of active ploop deltas with corresponding socket
- file descriptors in format %delta_path1%:%socket_fd1%[,...]. Parse it
- and return list of tuples.
- """
-
- FDFS_DELTAS_SEPARATOR = ","
- FDFS_PAIR_SEPARATOR = ":"
-
- if not fdfs:
- return []
-
- deltas = []
- for delta in fdfs.split(FDFS_DELTAS_SEPARATOR):
- path, dummy, fd = delta.rpartition(FDFS_PAIR_SEPARATOR)
- deltas.append((fs_haul_ploop.get_delta_abspath(path, self._ct_priv), int(fd)))
-
- return deltas
-
def restored(self, pid):
pass
@@ -313,6 +291,28 @@ class p_haul_type:
def dump_need_page_server(self):
return True
+ def __parse_fdfs_arg(self, fdfs):
+ """
+ Parse string containing list of ploop deltas with socket fds
+
+ String contain list of active ploop deltas with corresponding socket
+ file descriptors in format %delta_path1%:%socket_fd1%[,...]. Parse it
+ and return list of tuples.
+ """
+
+ FDFS_DELTAS_SEPARATOR = ","
+ FDFS_PAIR_SEPARATOR = ":"
+
+ if not fdfs:
+ return []
+
+ deltas = []
+ for delta in fdfs.split(FDFS_DELTAS_SEPARATOR):
+ path, dummy, fd = delta.rpartition(FDFS_PAIR_SEPARATOR)
+ deltas.append((fs_haul_ploop.get_delta_abspath(path, self._ct_priv), int(fd)))
+
+ return deltas
+
def add_hauler_args(parser):
"""Add Virtuozzo specific command line arguments"""
--
1.7.1
More information about the CRIU
mailing list