@@ -1064,6 +1064,20 @@ int xc_domain_set_virq_handler(xc_interface *xch, uint32_t domid, int virq);
int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,
uint32_t max_port);
+/**
+ * Set the maximum number of grant frames and/or maptrack frames a domain
+ * can have. Can only be used at domain setup time. A zero value means
+ * no change.
+ *
+ * @param xch a handle to an open hypervisor interface
+ * @param domid the domain id
+ * @param grant_frames max. number of grant frames
+ * @param maptrack_frames max. number of maptrack frames
+ */
+int xc_domain_set_gnttbl_limits(xc_interface *xch, uint32_t domid,
+ uint32_t grant_frames,
+ uint32_t maptrack_frames);
+
/*
* CPUPOOL MANAGEMENT FUNCTIONS
*/
@@ -2268,6 +2268,19 @@ int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,
return do_domctl(xch, &domctl);
}
+int xc_domain_set_gnttbl_limits(xc_interface *xch, uint32_t domid,
+ uint32_t grant_frames,
+ uint32_t maptrack_frames)
+{
+ DECLARE_DOMCTL;
+
+ domctl.cmd = XEN_DOMCTL_set_gnttbl_limits;
+ domctl.domain = domid;
+ domctl.u.set_gnttbl_limits.grant_frames = grant_frames;
+ domctl.u.set_gnttbl_limits.maptrack_frames = maptrack_frames;
+ return do_domctl(xch, &domctl);
+}
+
/* Plumbing Xen with vNUMA topology */
int xc_domain_setvnuma(xc_interface *xch,
uint32_t domid,
Add a new libxc function xc_domain_set_gnttbl_limits() setting the limits for the maximum numbers of grant table frames and maptrack frames of a domain. Signed-off-by: Juergen Gross <jgross@suse.com> --- tools/libxc/include/xenctrl.h | 14 ++++++++++++++ tools/libxc/xc_domain.c | 13 +++++++++++++ 2 files changed, 27 insertions(+)