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-devel

[Xen-devel] [PATCH 2/7] p2m_size is unnecessarily passed as a parameter

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2/7] p2m_size is unnecessarily passed as a parameter when it's available as a global variable.
From: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Date: Fri, 13 Nov 2009 23:43:02 +0000
Cc: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Delivery-date: Fri, 13 Nov 2009 15:40:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1258155787-28327-1-git-send-email-vincent.hanquez@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1258155787-28327-1-git-send-email-vincent.hanquez@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
p2m_size is unnecessarily passed as a parameter when it's available as a global 
variable.
it's leading to confusion to which one is used, hence removing the parameter
overshadowing the global.

---
 tools/libxc/xc_domain_save.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 697d93c..eb5d48d 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -401,7 +401,7 @@ static int print_stats(int xc_handle, uint32_t domid, int 
pages_sent,
 }
 
 
-static int analysis_phase(int xc_handle, uint32_t domid, int p2m_size,
+static int analysis_phase(int xc_handle, uint32_t domid,
                           unsigned long *arr, int runs)
 {
     long long start, now;
@@ -673,7 +673,6 @@ err0:
 static xen_pfn_t *map_and_save_p2m_table(int xc_handle, 
                                          int io_fd, 
                                          uint32_t dom,
-                                         unsigned long p2m_size,
                                          shared_info_any_t *live_shinfo)
 {
     vcpu_guest_context_any_t ctxt;
@@ -1027,7 +1026,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
         }
     }
 
-    analysis_phase(xc_handle, dom, p2m_size, to_skip, 0);
+    analysis_phase(xc_handle, dom, to_skip, 0);
 
     pfn_type   = xg_memalign(PAGE_SIZE, ROUNDUP(
                               MAX_BATCH_SIZE * sizeof(*pfn_type), PAGE_SHIFT));
@@ -1066,8 +1065,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
         int err = 0;
 
         /* Map the P2M table, and write the list of P2M frames */
-        live_p2m = map_and_save_p2m_table(xc_handle, io_fd, dom, 
-                                          p2m_size, live_shinfo);
+        live_p2m = map_and_save_p2m_table(xc_handle, io_fd, dom, live_shinfo);
         if ( live_p2m == NULL )
         {
             ERROR("Failed to map/save the p2m frame list");
-- 
1.6.5.2


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