Commit b0f40a27 authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

pycriu: images: treat tcp_stream image extra properly

Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 90b56c88
...@@ -203,6 +203,25 @@ class ghost_file_extra_handler: ...@@ -203,6 +203,25 @@ class ghost_file_extra_handler:
data = extra.decode('base64') data = extra.decode('base64')
f.write(data) 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 = { handlers = {
'INVENTORY' : entry_handler(inventory_entry), 'INVENTORY' : entry_handler(inventory_entry),
'CORE' : entry_handler(core_entry), 'CORE' : entry_handler(core_entry),
...@@ -214,7 +233,7 @@ handlers = { ...@@ -214,7 +233,7 @@ handlers = {
'GHOST_FILE' : entry_handler(ghost_file_entry, ghost_file_extra_handler()), 'GHOST_FILE' : entry_handler(ghost_file_entry, ghost_file_extra_handler()),
'MM' : entry_handler(mm_entry), 'MM' : entry_handler(mm_entry),
'CGROUP' : entry_handler(cgroup_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), 'STATS' : entry_handler(stats_entry),
'PAGEMAP' : pagemap_handler(), # Special one 'PAGEMAP' : pagemap_handler(), # Special one
'PSTREE' : entry_handler(pstree_entry), 'PSTREE' : entry_handler(pstree_entry),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment