[CRIU,2/3] p.haul: minor functions reordering in Virtuozzo hauler

Submitted by Nikita Spiridonov on June 21, 2016, 9:29 a.m.

Details

Message ID 1466501354-655212-3-git-send-email-nspiridonov@virtuozzo.com
State New
Series "Fix migration of Virtuozzo containers with multiple ploop disks"
Headers show

Commit Message

Nikita Spiridonov June 21, 2016, 9:29 a.m.
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@virtuozzo.com>
---
 phaul/p_haul_vz.py |   44 ++++++++++++++++++++++----------------------
 1 files changed, 22 insertions(+), 22 deletions(-)

Patch hide | download patch | download mbox

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"""