tools: libxc: restore: csum the correct page
authorWen Congyang <wency@cn.fujitsu.com>
Mon, 22 Sep 2014 05:59:14 +0000 (13:59 +0800)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 22 Sep 2014 14:18:19 +0000 (15:18 +0100)
In verify mode, we map the guest memory, and the guest page is
region_base + i * PAGE_SIZE. So we should csum page (region_base
+ i * PAGE_SIZE), not (region_base + (i+curbatch) * PAGE_SIZE)

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_domain_restore.c

index bec716c4cdc6d30bdae23809f4b1312d84f76d1f..fb4ddfc6b2a0c4920ac238fb14f96c73d0dc718e 100644 (file)
@@ -1405,7 +1405,7 @@ static int apply_batch(xc_interface *xch, uint32_t dom, struct restore_ctx *ctx,
 
                 DPRINTF("************** pfn=%lx type=%lx gotcs=%08lx "
                         "actualcs=%08lx\n", pfn, pagebuf->pfn_types[pfn],
-                        csum_page(region_base + (i + curbatch)*PAGE_SIZE),
+                        csum_page(region_base + i * PAGE_SIZE),
                         csum_page(buf));
 
                 for ( v = 0; v < 4; v++ )