[CRIU] [PATCH] p.haul: fix root_task_pid function for Virtuozzo containers

Nikita Spiridonov nspiridonov at virtuozzo.com
Thu Apr 28 09:59:46 PDT 2016


It is incorrect to grab root pid of container from first line of
cgroups tasks file; get root pid from pidfile instead.

Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
---
 phaul/p_haul_vz.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index 8f33a17..087ea7b 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -137,10 +137,9 @@ class p_haul_type:
 			req.opts.ghost_limit = 50 << 20
 
 	def root_task_pid(self):
-		# Expect first line of tasks file contain root pid of CT
-		path = "/sys/fs/cgroup/memory/{0}/tasks".format(self._ctid)
-		with open(path) as tasks:
-			pid = tasks.readline()
+		path = "/var/run/ve/{0}.init.pid".format(self._ctid)
+		with open(path) as pidfile:
+			pid = pidfile.read()
 			return int(pid)
 
 	def get_meta_images(self, path):
-- 
1.7.1



More information about the CRIU mailing list