[CRIU,1/2] p.haul: specify freezer cgroup for predump and dump requests in vz module

Submitted by Nikita Spiridonov on June 13, 2016, 8 a.m.

Details

Message ID 1465804848-695649-1-git-send-email-nspiridonov@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Nikita Spiridonov June 13, 2016, 8 a.m.
Specify freezer cgroup for predump and dump rpc requests for
Virtuozzo containers.

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

Patch hide | download patch | download mbox

diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index c65a7f0..97c2bec 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -123,6 +123,8 @@  class p_haul_type:
 
 	def adjust_criu_req(self, req):
 		"""Add module-specific options to criu request"""
+
+		# Specify dump specific options
 		if req.type == pycriu.rpc.DUMP:
 
 			# Specify root fs
@@ -138,6 +140,11 @@  class p_haul_type:
 			# Increase ghost-limit up to 50Mb
 			req.opts.ghost_limit = 50 << 20
 
+		# Specify freezer cgroup for both predump and dump requests
+		if req.type == pycriu.rpc.PRE_DUMP or req.type == pycriu.rpc.DUMP:
+			req.opts.freeze_cgroup = \
+				"/sys/fs/cgroup/freezer/{0}/".format(self._ctid)
+
 	def root_task_pid(self):
 		path = "/var/run/ve/{0}.init.pid".format(self._ctid)
 		with open(path) as pidfile: