aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_dom.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2013-10-14 10:25:39 +0200
committerJan Beulich <jbeulich@suse.com>2013-10-14 10:25:39 +0200
commita77eb86f44e52c5aea7f0ba7023600c043a9cdcd (patch)
treef999a21db3c0a9f170ce107b5a609ba2c74c1e6e /tools/libxl/libxl_dom.c
parent783b9e67f963bbb068b68fea4426131858145b0f (diff)
downloadxen-a77eb86f44e52c5aea7f0ba7023600c043a9cdcd.tar.gz
xen-a77eb86f44e52c5aea7f0ba7023600c043a9cdcd.tar.bz2
xen-a77eb86f44e52c5aea7f0ba7023600c043a9cdcd.zip
libxl,xl: add max_event_channels option to xl configuration file
Add the 'max_event_channels' option to the xl configuration file to limit the number of event channels that domain may use. Plumb this option through to libxl via a new libxl_build_info field and call xc_domain_set_max_evtchn() in the post build stage of domain creation. A new LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS #define indicates that this new field is available. The default value of 1023 limits the domain to using the minimum amount of global mapping pages and at most 5 xenheap pages. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/libxl/libxl_dom.c')
-rw-r--r--tools/libxl/libxl_dom.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 6e2252afbe..356f920a6d 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -268,6 +268,13 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
if (rc)
return rc;
+ rc = xc_domain_set_max_evtchn(ctx->xch, domid, info->event_channels);
+ if (rc) {
+ LOG(ERROR, "Failed to set event channel limit to %d (%d)",
+ info->event_channels, rc);
+ return ERROR_FAIL;
+ }
+
libxl_cpuid_apply_policy(ctx, domid);
if (info->cpuid != NULL)
libxl_cpuid_set(ctx, domid, info->cpuid);