[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix pinning logic on restore.



# HG changeset patch
# User smh22@xxxxxxxxxxxxxxxxxxxx
# Node ID 0adacfa2e33f25957a939015dd01d12312eb285e
# Parent  3f39f030fa894d29d04b748513bf48000d6a17f5
Fix pinning logic on restore. 

Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx>

diff -r 3f39f030fa89 -r 0adacfa2e33f tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c    Wed Nov 16 19:33:23 2005
+++ b/tools/libxc/xc_linux_restore.c    Thu Nov 17 09:10:52 2005
@@ -146,7 +146,7 @@
     unsigned long buf[PAGE_SIZE/sizeof(unsigned long)];
 
     struct mmuext_op pin[MAX_PIN_BATCH];
-    unsigned int nr_pins = 0;
+    unsigned int nr_pins; 
 
 
     max_pfn = nr_pfns; 
@@ -501,7 +501,16 @@
      * Pin page tables. Do this after writing to them as otherwise Xen
      * will barf when doing the type-checking.
      */
+    nr_pins = 0; 
     for (i = 0; i < max_pfn; i++) {
+
+        if (i == (max_pfn-1) || nr_pins == MAX_PIN_BATCH) {
+            if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
+                ERR("Failed to pin batch of %d page tables", nr_pins); 
+                goto out;
+            } 
+            nr_pins = 0;
+        }
 
         if ( (pfn_type[i] & LPINTAB) == 0 )
             continue;
@@ -529,16 +538,8 @@
         }
 
         pin[nr_pins].arg1.mfn = p2m[i];
-
-        nr_pins ++; 
-        
-        if (i == (max_pfn-1) || nr_pins == MAX_PIN_BATCH) {
-            if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
-                ERR("Failed to pin batch of %d page tables", nr_pins); 
-                goto out;
-            } 
-            nr_pins = 0;
-        }
+        nr_pins++; 
+
     }
 
     DPRINTF("\b\b\b\b100%%\n");

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.