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

[Xen-devel] [PATCH 1/6] export xc_map_m2p() so that it can be called outside.


  • To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
  • Date: Sun, 31 May 2009 19:10:50 +0800
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Sun, 31 May 2009 04:13:05 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acnh4HTXTJsjREY8Rm6Iq/DAC4WuZw==
  • Thread-topic: [PATCH 1/6] export xc_map_m2p() so that it can be called outside.

export xc_map_m2p() so that it can be called outside.

signed-off-by: Jiang, Yunhogn <yunhong.jiang@xxxxxxxxx>

diff -r d6c212abfed9 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Tue May 19 02:57:37 2009 +0800
+++ b/tools/libxc/xc_domain_save.c      Tue May 19 03:02:12 2009 +0800
@@ -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 d6c212abfed9 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h    Tue May 19 02:57:37 2009 +0800
+++ b/tools/libxc/xenguest.h    Tue May 19 03:13:47 2009 +0800
@@ -157,4 +157,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 */

Attachment: export_xc_map_m2p.patch
Description: export_xc_map_m2p.patch

_______________________________________________
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®.