criu/include/page-pipe.h
Pavel Emelyanov 8801f59615 mem: Protobuf format for page dumps
Since now we drain pages out of parasite, we can invent any format for
page dumps. Let is be ... prorobuf one! :)

Another thing to keep in mind, is that we're about to use splices and
implement iterative migration, so it's better to have actual pages be
page-aligned in the image.

And -- backward compatibility. That said the new format is:

1. pagemap-... file which contains a header (currently with a ID of
   the image with pages, see below) and an array of <nr_pages:vaddr>
   pairs. The first value means "how many pages to take from the
   file with pages (see below)" and the second -- where in the task
   address space to put them. Simple.

2. pages-... file which containes only pages one by one (thus aligned
   as we want).

This patch breaks backward compatibility (old images with pages wil
be restored and then crash). Need to do it before v0.5 release.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 18:16:41 +04:00

26 lines
673 B
C

#ifndef __CR_PAGE_PIPE_H__
#define __CR_PAGE_PIPE_H__
#include <sys/uio.h>
#include "list.h"
struct page_pipe_buf {
int p[2];
unsigned int pipe_size; /* how many pages can be fit into pipe */
unsigned int pages_in; /* how many pages are there */
unsigned int nr_segs; /* how many iov-s are busy */
struct iovec *iov;
struct list_head l;
};
struct page_pipe {
unsigned int nr_pipes;
struct list_head bufs;
unsigned int nr_iovs;
unsigned int free_iov;
struct iovec *iovs;
};
struct page_pipe *create_page_pipe(unsigned int nr, struct iovec *);
void destroy_page_pipe(struct page_pipe *p);
int page_pipe_add_page(struct page_pipe *p, unsigned long addr);
#endif