ia64/xen-unstable

changeset 14783:099593da38cb

Fix PV guest restore.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Apr 10 13:46:28 2007 +0100 (2007-04-10)
parents 17b360da7887
children ed4311db1cf6
files tools/libxc/xc_domain_restore.c
line diff
     1.1 --- a/tools/libxc/xc_domain_restore.c	Tue Apr 10 10:31:42 2007 +0100
     1.2 +++ b/tools/libxc/xc_domain_restore.c	Tue Apr 10 13:46:28 2007 +0100
     1.3 @@ -119,6 +119,7 @@ static int uncanonicalize_pagetable(int 
     1.4          {
     1.5              /* Have a 'valid' PFN without a matching MFN - need to alloc */
     1.6              p2m_batch[nr_mfns++] = pfn; 
     1.7 +            p2m[pfn]--;
     1.8          }
     1.9      }
    1.10  
    1.11 @@ -146,8 +147,8 @@ static int uncanonicalize_pagetable(int 
    1.12              continue;
    1.13          
    1.14          pfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
    1.15 -        
    1.16 -        if ( p2m[pfn] == INVALID_P2M_ENTRY )
    1.17 +
    1.18 +        if ( p2m[pfn] == (INVALID_P2M_ENTRY-1) )
    1.19              p2m[pfn] = p2m_batch[nr_mfns++];
    1.20  
    1.21          pte &= ~MADDR_MASK_X86;
    1.22 @@ -489,6 +490,7 @@ int xc_domain_restore(int xc_handle, int
    1.23              {
    1.24                  /* Have a live PFN which hasn't had an MFN allocated */
    1.25                  p2m_batch[nr_mfns++] = pfn; 
    1.26 +                p2m[pfn]--;
    1.27              }
    1.28          } 
    1.29  
    1.30 @@ -514,7 +516,7 @@ int xc_domain_restore(int xc_handle, int
    1.31                  region_mfn[i] = ~0UL; /* map will fail but we don't care */
    1.32              else 
    1.33              {
    1.34 -                if ( p2m[pfn] == INVALID_P2M_ENTRY )
    1.35 +                if ( p2m[pfn] == (INVALID_P2M_ENTRY-1) )
    1.36                  {
    1.37                      /* We just allocated a new mfn above; update p2m */
    1.38                      p2m[pfn] = p2m_batch[nr_mfns++];