WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Fix PV guest restore.

# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1176209188 -3600
# Node ID 099593da38cba5bba3b90f2ea44dfd060e94cb1f
# Parent  17b360da7887502d905e89d76cfca88bbf4840cf
Fix PV guest restore.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/libxc/xc_domain_restore.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -r 17b360da7887 -r 099593da38cb tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c   Tue Apr 10 10:31:42 2007 +0100
+++ b/tools/libxc/xc_domain_restore.c   Tue Apr 10 13:46:28 2007 +0100
@@ -119,6 +119,7 @@ static int uncanonicalize_pagetable(int 
         {
             /* 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 
             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
             {
                 /* 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
                 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++]; 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix PV guest restore., Xen patchbot-unstable <=