[CRIU] [PATCH 1/7] zdtm: Add maps02 test

Cyrill Gorcunov gorcunov at openvz.org
Wed May 16 06:51:14 EDT 2012


On Wed, May 16, 2012 at 02:43:23PM +0400, Andrew Vagin wrote:
> > +int main(int argc, char ** argv)
> > +{
> > +	const char fname[] = "maps02-test";
> 
> char *filename;
> TEST_OPTION(filename, string, "file name", 1);
> 

ok, thanks.

> > +
> > +	for (i = 0; i < MAPS_LEN / sizeof(long); i++)
> > +		write(fd, &data, sizeof(data));
> Where are you use fd?

It's to have data written in file. Not sure what you mean.

> > +
> > +	if (remap_file_pages(map + 0x1000, 0x1000, 0, 0, 0)) {
> Where is remap_file_pages declared?

sys/mman.h

> > +		fail("Can't remap file pages %s\n", fname);
> > +		exit(1);
> > +	}
> > +
> > +	test_daemon();
> > +	test_waitsig();
> Probably we should check that all mappings restored.

Not yet. We don't support non-linear mapping restore.
I needed this test simply to check that we do parse
procfs properly.

	Cyrill


More information about the CRIU mailing list