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

[Xen-devel] [PATCH RFC/WIPv2 2/6] libxc: support XENMEM_transfer operation



Introduce xc_domain_transfer_pages() function supporting XENMEM_transfer.

Signed-off-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
---
 tools/libxc/xc_domain.c | 19 +++++++++++++++++++
 tools/libxc/xenctrl.h   |  6 ++++++
 2 files changed, 25 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 1a6f90a..b844f8b 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -924,6 +924,25 @@ int xc_domain_claim_pages(xc_interface *xch,
     return err;
 }
 
+int xc_domain_transfer_pages(xc_interface *xch,
+                             uint32_t source_domid,
+                             uint32_t dest_domid,
+                             xen_pfn_t gmfn_start,
+                             uint64_t gmfn_count)
+{
+    int err;
+    struct xen_memory_transfer trans = {
+        .source_domid   = source_domid,
+        .dest_domid     = dest_domid,
+        .gmfn_start      = gmfn_start,
+        .gmfn_count      = gmfn_count,
+        .nr_transferred = 0
+    };
+
+    err = do_memory_op(xch, XENMEM_transfer, &trans, sizeof(trans));
+    return err;
+}
+
 int xc_domain_populate_physmap(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_extents,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 514b241..cff36c6 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1353,6 +1353,12 @@ int xc_domain_claim_pages(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_pages);
 
+int xc_domain_transfer_pages(xc_interface *xch,
+                            uint32_t source_domid,
+                            uint32_t dest_domid,
+                            xen_pfn_t gmfn_start,
+                            uint64_t gmfn_count);
+
 int xc_domain_memory_exchange_pages(xc_interface *xch,
                                     int domid,
                                     unsigned long nr_in_extents,
-- 
1.9.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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