[CRIU] Fix rollback for Virtuozzo container migration in restart mode

Submitted by Nikita Spiridonov on Aug. 24, 2016, 10:37 a.m.

Details

Message ID 1472035078-351641-1-git-send-email-nspiridonov@virtuozzo.com
State New
Series "Fix rollback for Virtuozzo container migration in restart mode"
Headers show

Commit Message

Nikita Spiridonov Aug. 24, 2016, 10:37 a.m.
Fix rollback for Virtuozzo container migration in restart mode -
fail migration if can't start container on target host. Without
current fix container migrate successfully but stay in stopped
state.

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

Patch hide | download patch | download mbox

diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index 7db51e7..8e56745 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -304,6 +304,8 @@  class p_haul_type:
 			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 		proc_output = proc.communicate()[0]
 		util.log_subprocess_output(proc_output)
+		if proc.returncode != 0:
+			raise Exception("Start failed ({0})".format(proc.returncode))
 		self._fs_mounted = True
 
 	def stop(self, umount):