tools/xl: fix segfault in xl migrate --debug
authorM A Young <m.a.young@durham.ac.uk>
Thu, 18 Dec 2014 10:02:16 +0000 (10:02 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 18 Dec 2014 10:02:16 +0000 (10:02 +0000)
If differences are found during the verification phase of xl migrate
--debug then it is likely to crash with a segfault because the bogus
pagebuf->pfn_types[pfn] is used in a print statement instead of
pfn_type[pfn] .

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_domain_restore.c

index d8bd9b38570da74a1755aced68ed1003eed7a5f5..a382701bbb4958a12ec6d13c9dc5eb5d1479d195 100644 (file)
@@ -1404,7 +1404,7 @@ static int apply_batch(xc_interface *xch, uint32_t dom, struct restore_ctx *ctx,
                 int v;
 
                 DPRINTF("************** pfn=%lx type=%lx gotcs=%08lx "
-                        "actualcs=%08lx\n", pfn, pagebuf->pfn_types[pfn],
+                        "actualcs=%08lx\n", pfn, pfn_type[pfn],
                         csum_page(region_base + i * PAGE_SIZE),
                         csum_page(buf));