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

[Xen-devel] [PATCH v6 06/10] libxc: support XENMEM_soft_reset operation



Introduce xc_domain_memory_soft_reset() function supporting XENMEM_soft_reset.

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

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index a689caf..cb1bb15 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1381,6 +1381,11 @@ int xc_domain_claim_pages(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_pages);
 
+int xc_domain_memory_soft_reset(xc_interface *xch,
+                                uint32_t source_domid,
+                                uint32_t dest_domid,
+                                uint64_t *nr_trans);
+
 int xc_domain_memory_exchange_pages(xc_interface *xch,
                                     int domid,
                                     unsigned long nr_in_extents,
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index a7079a1..be39987 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -976,6 +976,24 @@ int xc_domain_claim_pages(xc_interface *xch,
     return err;
 }
 
+int xc_domain_memory_soft_reset(xc_interface *xch,
+                                uint32_t source_domid,
+                                uint32_t dest_domid,
+                                uint64_t *nr_trans)
+{
+    int err;
+    struct xen_memory_soft_reset softr = {
+        .source_domid   = source_domid,
+        .dest_domid     = dest_domid,
+        .gmfn_start     = 0,
+        .nr_transferred = 0
+    };
+
+    err = do_memory_op(xch, XENMEM_soft_reset, &softr, sizeof(softr));
+    *nr_trans = softr.nr_transferred;
+    return err;
+}
+
 int xc_domain_populate_physmap(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_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®.