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

[Xen-devel] [PATCH RFCv3 4/8] libxc: support XEN_DOMCTL_set_recipient



Introduce new xc_domain_set_recipient() function to support
XEN_DOMCTL_set_recipient.

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

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 14f4666..2c69087 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -92,6 +92,16 @@ int xc_domain_destroy(xc_interface *xch,
     return ret;
 }
 
+int xc_domain_set_recipient(xc_interface *xch,
+                            uint32_t domid, uint32_t recipient)
+{
+    DECLARE_DOMCTL;
+    domctl.cmd = XEN_DOMCTL_set_recipient;
+    domctl.domain = (domid_t)domid;
+    domctl.u.recipient.recipient = (domid_t)recipient;
+    return do_domctl(xch, &domctl);
+}
+
 int xc_domain_shutdown(xc_interface *xch,
                        uint32_t domid,
                        int reason)
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 514b241..e59c718 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -551,6 +551,20 @@ int xc_domain_unpause(xc_interface *xch,
 int xc_domain_destroy(xc_interface *xch,
                       uint32_t domid);
 
+/**
+ * This function sets a 'recipient' domain for a domain (when the source domain
+ * releases memory it is being reassigned to the recipient domain instead of
+ * being freed). The destination domain is supposed to have enough max_mem.
+ * Supplying DOMID_INVALID as a recipient cleans things up.
+ *
+ * @parm xch a handle to an open hypervisor interface
+ * @parm domid the source domain id
+ * @parm recipient the destrination domain id
+ * @return 0 on success, -1 on failure
+ */
+int xc_domain_set_recipient(xc_interface *xch,
+                            uint32_t domid, uint32_t recipient);
+
 
 /**
  * This function resumes a suspended domain. The domain should have
-- 
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®.