Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Kuprieiev <kupruser@gmail.com>2015-01-28 21:38:00 +0300
committerPavel Emelyanov <xemul@parallels.com>2015-01-29 18:43:36 +0300
commitb0f40a2726e53478f2b714b602e42df98530f5ca (patch)
tree3aaf70f2e94338669e93f297a93c2028ea294a9f
parent90b56c882e99c6c8fef64904a01e7ac83c27cf6f (diff)
pycriu: images: treat tcp_stream image extra properly
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r--pycriu/images/images.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/pycriu/images/images.py b/pycriu/images/images.py
index 8c4b73eb9..3d4d1c8e7 100644
--- a/pycriu/images/images.py
+++ b/pycriu/images/images.py
@@ -203,6 +203,25 @@ class ghost_file_extra_handler:
data = extra.decode('base64')
f.write(data)
+class tcp_stream_extra_handler:
+ def load(self, f, pb):
+ d = {}
+
+ inq = f.read(pb.inq_len)
+ outq = f.read(pb.outq_len)
+
+ d['inq'] = inq.encode('base64')
+ d['outq'] = outq.encode('base64')
+
+ return d
+
+ def dump(self, extra, f, pb):
+ inq = extra['inq'].decode('base64')
+ outq = extra['outq'].decode('base64')
+
+ f.write(inq)
+ f.write(outq)
+
handlers = {
'INVENTORY' : entry_handler(inventory_entry),
'CORE' : entry_handler(core_entry),
@@ -214,7 +233,7 @@ handlers = {
'GHOST_FILE' : entry_handler(ghost_file_entry, ghost_file_extra_handler()),
'MM' : entry_handler(mm_entry),
'CGROUP' : entry_handler(cgroup_entry),
- 'TCP_STREAM' : entry_handler(tcp_stream_entry),
+ 'TCP_STREAM' : entry_handler(tcp_stream_entry, tcp_stream_extra_handler()),
'STATS' : entry_handler(stats_entry),
'PAGEMAP' : pagemap_handler(), # Special one
'PSTREE' : entry_handler(pstree_entry),