[CRIU] [PATCH 10/12] p.haul: add pre_final_setup function
Alexander Burluka
aburluka at virtuozzo.com
Mon Apr 4 07:27:19 PDT 2016
Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
---
phaul/p_haul_docker.py | 3 +++
phaul/p_haul_lxc.py | 3 +++
phaul/p_haul_pid.py | 3 +++
phaul/p_haul_vz.py | 5 +++++
phaul/service.py | 3 +++
5 files changed, 17 insertions(+)
diff --git a/phaul/p_haul_docker.py b/phaul/p_haul_docker.py
index 626ebd0..abb1716 100644
--- a/phaul/p_haul_docker.py
+++ b/phaul/p_haul_docker.py
@@ -138,6 +138,9 @@ class p_haul_type:
pid = int(line.split(None, 1)[0])
os.kill(pid, signal.SIGKILL)
+ def pre_final_setup(self, source_data):
+ pass
+
def final_restore(self, img, criu):
logf = open("/tmp/docker_restore.log", "w+")
diff --git a/phaul/p_haul_lxc.py b/phaul/p_haul_lxc.py
index 5303574..8dc77b5 100644
--- a/phaul/p_haul_lxc.py
+++ b/phaul/p_haul_lxc.py
@@ -118,6 +118,9 @@ class p_haul_type:
def final_dump(self, pid, img, ccon, fs):
criu_cr.criu_dump(self, pid, img, ccon, fs)
+ def pre_final_setup(self, source_data):
+ pass
+
def final_restore(self, img, connection):
criu_cr.criu_restore(self, img, connection)
diff --git a/phaul/p_haul_pid.py b/phaul/p_haul_pid.py
index 061a766..ae32699 100644
--- a/phaul/p_haul_pid.py
+++ b/phaul/p_haul_pid.py
@@ -73,6 +73,9 @@ class p_haul_type:
def final_dump(self, pid, img, ccon, fs):
criu_cr.criu_dump(self, pid, img, ccon, fs)
+ def pre_final_setup(self, source_data):
+ pass
+
def final_restore(self, img, connection):
criu_cr.criu_restore(self, img, connection)
diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index 8055f69..8321520 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -166,6 +166,11 @@ class p_haul_type:
def final_dump(self, pid, img, ccon, fs):
criu_cr.criu_dump(self, pid, img, ccon, fs)
+ def pre_final_setup(self, src_data):
+ if "shareds" in src_data:
+ for ploop in src_data["shareds"]:
+ fs_haul_ploop.merge_ploop_snapshot(ploop["ddxml"], ploop["guid"])
+
def final_restore(self, img, connection):
"""Perform Virtuozzo-specific final restore"""
try:
diff --git a/phaul/service.py b/phaul/service.py
index ecb0cc8..62b7ff6 100644
--- a/phaul/service.py
+++ b/phaul/service.py
@@ -115,3 +115,6 @@ class phaul_service:
self.htype.start()
logging.info("Start succeeded")
self.restored = True
+
+ def rpc_final_cleanup(self, src_data):
+ self.htype.pre_final_setup(src_data)
--
1.8.3.1
More information about the CRIU
mailing list