[CRIU] [PATCH 3/5] crit: Add dump method for shmem pages

Cyrill Gorcunov gorcunov at openvz.org
Thu Dec 10 02:07:04 PST 2015


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pycriu/images/images.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pycriu/images/images.py b/pycriu/images/images.py
index 7c01d3f19b9f..c9146ab515bf 100644
--- a/pycriu/images/images.py
+++ b/pycriu/images/images.py
@@ -286,7 +286,12 @@ class ipc_shm_handler:
 		return data.encode('base64')
 
 	def dump(self, extra, f, pb):
-		raise Exception("Not yet implemented")
+		entry = pb2dict.pb2dict(pb)
+		size = entry['size']
+		data = extra.decode('base64')
+		rounded = round_up(size, sizeof_u32)
+		f.write(data[:size])
+		f.write('\0' * (rounded - size))
 
 handlers = {
 	'INVENTORY'		: entry_handler(inventory_entry),
-- 
2.5.0



More information about the CRIU mailing list