Commit aa91dbfc authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

crit: Add dump method for shmem pages

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 57fbb4e5
......@@ -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),
......
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