From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dushyant Behl Subject: [PATCH v2 2/3] [GSOC14] Replacing Deprecated Function Calls. Date: Mon, 16 Jun 2014 23:50:50 +0530 Message-ID: <1402942851-12538-3-git-send-email-myselfdushyantbehl@gmail.com> References: <1402942851-12538-1-git-send-email-myselfdushyantbehl@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402942851-12538-1-git-send-email-myselfdushyantbehl@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: David Scott , Stefano Stabellini , Andrew Cooper , Ian Jackson , Andres Lagar Cavilla , Dushyant Behl , Ian Campbell List-Id: xen-devel@lists.xenproject.org This patch is part of the work done under the gsoc project - Lazy Restore Using Memory Paging. This patch replaces the calls to the deprecated function xc_map_foreign_batch with the calls to xc_map_foreign_bulk in tools/libxc/xc_mem_paging_ring_setup.c The function xc_map_foreign_bulk has a cleaner error reporting interface than xc_map_foreign_batch. Signed-off-by: Dushyant Behl Reviewed-by: Andres Lagar-Cavilla Reviewed-by: Andrew Cooper --- tools/libxc/xc_mem_paging_setup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/libxc/xc_mem_paging_setup.c b/tools/libxc/xc_mem_paging_setup.c index 4e5fe73..679c606 100644 --- a/tools/libxc/xc_mem_paging_setup.c +++ b/tools/libxc/xc_mem_paging_setup.c @@ -43,15 +43,15 @@ int xc_mem_paging_ring_setup(xc_interface *xch, uint32_t *evtchn_port, mem_event_back_ring_t *back_ring) { - int rc; + int rc, err; uint64_t ring_pfn, mmap_pfn; /* Map the ring page */ xc_get_hvm_param(xch, domain_id, HVM_PARAM_PAGING_RING_PFN, &ring_pfn); mmap_pfn = ring_pfn; - ring_page = xc_map_foreign_batch(xch, domain_id, - PROT_READ | PROT_WRITE, &mmap_pfn, 1); - if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB ) + ring_page = xc_map_foreign_bulk(xch, domain_id, + PROT_READ | PROT_WRITE, &mmap_pfn, &err, 1); + if ( (err != 0) || (ring_page == NULL) ) { /* Map failed, populate ring page */ rc = xc_domain_populate_physmap_exact(xch, domain_id, @@ -63,10 +63,10 @@ int xc_mem_paging_ring_setup(xc_interface *xch, } mmap_pfn = ring_pfn; - ring_page = xc_map_foreign_batch(xch, domain_id, - PROT_READ | PROT_WRITE, &mmap_pfn, 1); + ring_page = xc_map_foreign_bulk(xch, domain_id, + PROT_READ | PROT_WRITE, &mmap_pfn, &err, 1); - if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB ) + if ( (err != 0) || (ring_page == NULL) ) { PERROR("Could not map the ring page\n"); return -1; -- 1.9.1