[CRIU] Re: [PATCH] cr: reuse zero_page_entry in fixup_pages_data
Cyrill Gorcunov
gorcunov at openvz.org
Mon Jan 30 13:41:06 EST 2012
On Mon, Jan 30, 2012 at 10:36:57PM +0400, Konstantin Khlebnikov wrote:
> fix compilation error:
> cr-restore.c:621:13: error: variably modified ‘zpage’ at file scope
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
> ---
> cr-restore.c | 6 +-----
> 1 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/cr-restore.c b/cr-restore.c
> index 172bc6b..f9ce3d3 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -618,8 +618,6 @@ static inline bool should_restore_page(int pid, unsigned long va)
> return si->pid == pid;
> }
>
> -static char zpage[PAGE_SIZE];
> -
> static int fixup_pages_data(int pid, int fd)
> {
> int shfd;
> @@ -675,9 +673,7 @@ static int fixup_pages_data(int pid, int fd)
> }
>
> close(shfd);
> - va = 0;
> - write(fd, &va, sizeof(va));
> - write(fd, zpage, sizeof(zpage));
> + write_img(fd, &zero_page_entry);
>
> return 0;
> }
>
This will screw the image, virtual address is expected
first and then page data, so
va = 0;
write(fd, &va, sizeof(va));
is still needed.
Cyrill
More information about the CRIU
mailing list