aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-04-10 13:46:28 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-04-10 13:46:28 +0100
commite2492c5e9e72ffc0ddb2765080b579200fd8f1c8 (patch)
treec0c31ca5d9effc7a47245d9234910a053e347af1
parent03323f278d5c8b276e36c26ae353025c5a548fa7 (diff)
downloadxen-e2492c5e9e72ffc0ddb2765080b579200fd8f1c8.tar.gz
xen-e2492c5e9e72ffc0ddb2765080b579200fd8f1c8.tar.bz2
xen-e2492c5e9e72ffc0ddb2765080b579200fd8f1c8.zip
Fix PV guest restore.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--tools/libxc/xc_domain_restore.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index f424d291a6..1159776f4f 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -119,6 +119,7 @@ static int uncanonicalize_pagetable(int xc_handle, uint32_t dom,
{
/* Have a 'valid' PFN without a matching MFN - need to alloc */
p2m_batch[nr_mfns++] = pfn;
+ p2m[pfn]--;
}
}
@@ -146,8 +147,8 @@ static int uncanonicalize_pagetable(int xc_handle, uint32_t dom,
continue;
pfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-
- if ( p2m[pfn] == INVALID_P2M_ENTRY )
+
+ if ( p2m[pfn] == (INVALID_P2M_ENTRY-1) )
p2m[pfn] = p2m_batch[nr_mfns++];
pte &= ~MADDR_MASK_X86;
@@ -489,6 +490,7 @@ int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
{
/* Have a live PFN which hasn't had an MFN allocated */
p2m_batch[nr_mfns++] = pfn;
+ p2m[pfn]--;
}
}
@@ -514,7 +516,7 @@ int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
region_mfn[i] = ~0UL; /* map will fail but we don't care */
else
{
- if ( p2m[pfn] == INVALID_P2M_ENTRY )
+ if ( p2m[pfn] == (INVALID_P2M_ENTRY-1) )
{
/* We just allocated a new mfn above; update p2m */
p2m[pfn] = p2m_batch[nr_mfns++];