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

[Xen-devel] [PATCH 5/7] alias i/FPP(guest_width) as p2m_index and replace every usage



alias i/FPP(guest_width) as p2m_index and replace every usage
---
 tools/libxc/xc_domain_save.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 341b0e0..61cc589 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -753,24 +753,25 @@ static xen_pfn_t *map_and_save_p2m_table(int xc_handle,
     /* Canonicalise the pfn-to-mfn table frame-number list. */
     for ( i = 0; i < ctx->p2m_size; i += FPP(ctx->guest_width) )
     {
-        if ( !MFN_IS_IN_PSEUDOPHYS_MAP(ctx->max_mfn, 
p2m_frame_list[i/FPP(ctx->guest_width)]) )
+        uint32_t p2m_index = i / FPP(ctx->guest_width);
+        if ( !MFN_IS_IN_PSEUDOPHYS_MAP(ctx->max_mfn, 
p2m_frame_list[p2m_index]) )
         {
             ERROR("Frame# in pfn-to-mfn frame list is not in pseudophys");
             ERROR("entry %d: p2m_frame_list[%ld] is 0x%"PRIx64", max 0x%lx",
-                  i, i/FPP(ctx->guest_width), 
(uint64_t)p2m_frame_list[i/FPP(ctx->guest_width)], ctx->max_mfn);
-            if ( p2m_frame_list[i/FPP(ctx->guest_width)] < ctx->max_mfn ) 
+                  i, p2m_index, (uint64_t)p2m_frame_list[p2m_index], 
ctx->max_mfn);
+            if ( p2m_frame_list[p2m_index] < ctx->max_mfn )
             {
                 ERROR("m2p[0x%"PRIx64"] = 0x%"PRIx64, 
-                      (uint64_t)p2m_frame_list[i/FPP(ctx->guest_width)],
-                      
(uint64_t)ctx->live_m2p[p2m_frame_list[i/FPP(ctx->guest_width)]]);
+                      (uint64_t)p2m_frame_list[p2m_index],
+                      (uint64_t)ctx->live_m2p[p2m_frame_list[p2m_index]]);
                 ERROR("p2m[0x%"PRIx64"] = 0x%"PRIx64, 
-                      
(uint64_t)ctx->live_m2p[p2m_frame_list[i/FPP(ctx->guest_width)]],
-                      
(uint64_t)p2m[ctx->live_m2p[p2m_frame_list[i/FPP(ctx->guest_width)]]]);
+                      (uint64_t)ctx->live_m2p[p2m_frame_list[p2m_index]],
+                      (uint64_t)p2m[ctx->live_m2p[p2m_frame_list[p2m_index]]]);
 
             }
             goto out;
         }
-        p2m_frame_list[i/FPP(ctx->guest_width)] = 
mfn_to_pfn(p2m_frame_list[i/FPP(ctx->guest_width)]);
+        p2m_frame_list[p2m_index] = mfn_to_pfn(p2m_frame_list[p2m_index]);
     }
 
     if ( xc_vcpu_getcontext(xc_handle, dom, 0, &ctxt) )
-- 
1.6.5.2


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


 


Rackspace

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