2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

crit: Add dump method for shmem pages

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2015-12-10 13:07:04 +03:00 committed by Pavel Emelyanov
parent 57fbb4e5d3
commit aa91dbfc09

View File

@ -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),