[CRIU] [PATCH 3/4] deduplication: Compare predump files, old from "predump" directory
Pavel Emelyanov
xemul at parallels.com
Thu Oct 10 01:53:47 PDT 2013
> + for (i = 0; i < nr; i++) {
> + unsigned char buf[PAGE_SIZE];
> + unsigned char buf2[PAGE_SIZE];
> +
> + ret = pr.read_page(&pr, va, buf);
> + if (ret < 0) {
> + pr_err("Can't read page");
> + goto exit;
> + }
> +
> + ret = pr2.read_page(&pr2, va, buf2);
> + if (ret < 0) {
> + pr_err("Can't read page");
> + goto exit;
> + }
> +
> + if (memcmp(buf, buf2, PAGE_SIZE) != 0) {
> + pr_info("Pages Not Equal : %lu\n", va);
> + } else {
> +
> + }
> +
> + off++;
> + va += PAGE_SIZE;
Don't compare page contents. Just punch holes from "parent" pages-%d.img files, that
have date in respective places in the working dir's pages-%.img ones.
More information about the CRIU
mailing list