criu/include/page-read.h
Pavel Emelyanov 3307bfd8f1 restore: Restore memory from stack of snapshots
This one is a little bit more tricky that dump. On restore we
should open the chain of pagemap-s (by "parent" links). Then for
every pagemap with in_parent set we should go to parent and ask
for the page. Parent, in turn, should properly determine where
the respective page is in his pagemap and position the page.img's
position respectively.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-12 19:45:22 +04:00

21 lines
499 B
C

#ifndef __CR_PAGE_READ_H__
#define __CR_PAGE_READ_H__
#include "protobuf/pagemap.pb-c.h"
struct page_read {
int (*get_pagemap)(struct page_read *, struct iovec *iov);
int (*read_page)(struct page_read *, unsigned long vaddr, void *);
void (*put_pagemap)(struct page_read *);
void (*close)(struct page_read *);
int fd;
int fd_pg;
PagemapEntry *pe;
struct page_read *parent;
unsigned long cvaddr;
unsigned id; /* for logging */
};
int open_page_read(int pid, struct page_read *);
#endif