[CRIU] [PATCH] p.haul: fix vzctl utility calls in vz module

Nikita Spiridonov nspiridonov at odin.com
Mon Nov 2 03:20:14 PST 2015


Pass "--skiplock" option to vzctl calls.

For vz module p.haul execed during container migration via vzmigrate
utility and as a result container already locked. I think we can pass
"--skiplock" option to vzctl utility unconditionally since it is
primary scenario for vz module of p.haul.

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

diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index 903006d..1effa93 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -158,8 +158,8 @@ class p_haul_type:
 			self.__setup_restore_extra_args(args_path, img, connection)
 			# Run vzctl restore
 			logging.info("Starting vzctl restore")
-			proc = subprocess.Popen([vzctl_bin, "restore", self._ctid,
-				"--dumpfile", img.image_dir()],
+			proc = subprocess.Popen([vzctl_bin, "--skiplock", "restore",
+				self._ctid, "--dumpfile", img.image_dir()],
 				stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 			proc_output = proc.communicate()[0]
 			logging.info(proc_output)
@@ -181,7 +181,8 @@ class p_haul_type:
 	def mount(self):
 		logging.info("Mounting CT root to %s", self._ct_root)
 		logging.info("Starting vzctl mount")
-		proc = subprocess.Popen(["vzctl", "mount", self._ctid],
+		proc = subprocess.Popen(
+			[vzctl_bin, "--skiplock", "mount", self._ctid],
 			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 		proc_output = proc.communicate()[0]
 		logging.info(proc_output)
@@ -192,7 +193,8 @@ class p_haul_type:
 		if self._fs_mounted:
 			logging.info("Umounting CT root")
 			logging.info("Starting vzctl umount")
-			proc = subprocess.Popen(["vzctl", "umount", self._ctid],
+			proc = subprocess.Popen(
+				[vzctl_bin, "--skiplock", "umount", self._ctid],
 				stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 			proc_output = proc.communicate()[0]
 			logging.info(proc_output)
-- 
1.7.1



More information about the CRIU mailing list