p.haul: forward correct verbosity level to criu restore

Submitted by Nikita Spiridonov on May 4, 2016, 1:27 p.m.

Details

Message ID 1462368427-293756-1-git-send-email-nspiridonov@virtuozzo.com
State Rejected
Series "p.haul: forward correct verbosity level to criu restore"
Headers show

Commit Message

Nikita Spiridonov May 4, 2016, 1:27 p.m.
Forward correct verbosity level to criu restore during Virtuozzo
containers live migration.

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

Patch hide | download patch | download mbox

diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index 8f33a17..ffcd83c 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -7,6 +7,7 @@  import subprocess
 import shlex
 import logging
 import criu_cr
+import criu_api
 import util
 import fs_haul_ploop
 import pycriu.rpc
@@ -45,6 +46,7 @@  class p_haul_type:
 		# v_bridge is the bridge to which thie veth is attached
 		#
 		self._veths = []
+		self.__verbose = criu_api.def_verb
 
 	def __load_ct_config(self, path):
 		logging.info("Loading config file from %s", path)
@@ -117,7 +119,7 @@  class p_haul_type:
 		self.__load_ct_config_dst(vz_conf_dir)
 
 	def set_options(self, opts):
-		pass
+		self.__verbose = opts["verbose"]
 
 	def adjust_criu_req(self, req):
 		"""Add module-specific options to criu request"""
@@ -154,7 +156,8 @@  class p_haul_type:
 		extra_args = [
 			"VE_WORK_DIR={0}\n".format(img.work_dir()),
 			"VE_RESTORE_LOG_PATH={0}\n".format(
-				connection.get_log_name(pycriu.rpc.RESTORE))]
+				connection.get_log_name(pycriu.rpc.RESTORE)),
+			"VE_CRIU_LOGLEVEL={0}\n".format(self.__verbose)]
 		with open(path, "w") as f:
 			f.writelines(extra_args)
 

Comments

Pavel Emelianov May 16, 2016, 1:27 p.m.
Applied