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] libxc: export xc_map_m2p() so that it can

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxc: export xc_map_m2p() so that it can be called outside.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 Jun 2009 10:45:15 -0700
Delivery-date: Tue, 02 Jun 2009 10:45:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243861973 -3600
# Node ID bd39df93a29e015e93b708639756661c3419b602
# Parent  84c1f7c46444eaa33fc14fc519ebfc5f11098903
libxc: export xc_map_m2p() so that it can be called outside.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@xxxxxxxxx>
---
 tools/libxc/xc_domain_save.c |   10 ++++++----
 tools/libxc/xenguest.h       |   13 +++++++++++++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff -r 84c1f7c46444 -r bd39df93a29e tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Mon Jun 01 14:08:58 2009 +0100
+++ b/tools/libxc/xc_domain_save.c      Mon Jun 01 14:12:53 2009 +0100
@@ -510,9 +510,10 @@ static int canonicalize_pagetable(unsign
     return race;
 }
 
-static xen_pfn_t *xc_map_m2p(int xc_handle,
+xen_pfn_t *xc_map_m2p(int xc_handle,
                                  unsigned long max_mfn,
-                                 int prot)
+                                 int prot,
+                                 unsigned long *mfn0)
 {
     struct xen_machphys_mfn_list xmml;
     privcmd_mmap_entry_t *entries;
@@ -561,7 +562,8 @@ static xen_pfn_t *xc_map_m2p(int xc_hand
         goto err2;
     }
 
-    m2p_mfn0 = entries[0].mfn;
+    if (mfn0)
+        *mfn0 = entries[0].mfn;
 
 err2:
     free(entries);
@@ -949,7 +951,7 @@ int xc_domain_save(int xc_handle, int io
     }
 
     /* Setup the mfn_to_pfn table mapping */
-    if ( !(live_m2p = xc_map_m2p(xc_handle, max_mfn, PROT_READ)) )
+    if ( !(live_m2p = xc_map_m2p(xc_handle, max_mfn, PROT_READ, &m2p_mfn0)) )
     {
         ERROR("Failed to map live M2P table");
         goto out;
diff -r 84c1f7c46444 -r bd39df93a29e tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h    Mon Jun 01 14:08:58 2009 +0100
+++ b/tools/libxc/xenguest.h    Mon Jun 01 14:12:53 2009 +0100
@@ -163,4 +163,17 @@ int xc_query_page_offline_status(int xc,
 int xc_query_page_offline_status(int xc, unsigned long start,
                                  unsigned long end, uint32_t *status);
 
+
+/**
+ * This function map m2p table
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm max_mfn the max pfn
+ * @parm prot the flags to map, such as read/write etc
+ * @parm mfn0 return the first mfn, can be NULL
+ * @return mapped m2p table on success, NULL on failure
+ */
+xen_pfn_t *xc_map_m2p(int xc_handle,
+                      unsigned long max_mfn,
+                      int prot,
+                      unsigned long *mfn0);
 #endif /* XENGUEST_H */

_______________________________________________
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] libxc: export xc_map_m2p() so that it can be called outside., Xen patchbot-unstable <=