ia64/xen-unstable

changeset 18561:ccf0205255e1

xc_save: use correct size when unmapping live p2m.

Otherwise we unmap a larger region than was mapped when saving 32 bit
guest from 64 bit tools, leading to badness.

The equivalent change was made to the restore code in
18329:ca7dd77d5365

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Sep 29 11:00:29 2008 +0100 (2008-09-29)
parents 2e7f5c177495
children 22c9434c5d3e
files tools/libxc/xc_domain_save.c
line diff
     1.1 --- a/tools/libxc/xc_domain_save.c	Mon Sep 29 09:43:05 2008 +0100
     1.2 +++ b/tools/libxc/xc_domain_save.c	Mon Sep 29 11:00:29 2008 +0100
     1.3 @@ -727,7 +727,7 @@ static xen_pfn_t *map_and_save_p2m_table
     1.4   out:
     1.5      
     1.6      if ( !success && p2m )
     1.7 -        munmap(p2m, ROUNDUP(p2m_size * sizeof(xen_pfn_t), PAGE_SHIFT));
     1.8 +        munmap(p2m, P2M_FLL_ENTRIES * PAGE_SIZE);
     1.9  
    1.10      if ( live_p2m_frame_list_list )
    1.11          munmap(live_p2m_frame_list_list, PAGE_SIZE);
    1.12 @@ -1608,7 +1608,7 @@ int xc_domain_save(int xc_handle, int io
    1.13          munmap(live_shinfo, PAGE_SIZE);
    1.14  
    1.15      if ( live_p2m )
    1.16 -        munmap(live_p2m, ROUNDUP(p2m_size * sizeof(xen_pfn_t), PAGE_SHIFT));
    1.17 +        munmap(live_p2m, P2M_FLL_ENTRIES * PAGE_SIZE);
    1.18  
    1.19      if ( live_m2p )
    1.20          munmap(live_m2p, M2P_SIZE(max_mfn));